{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 10 : Phase Diagram and Equilibrium Diagram"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 10.1 pageno : 251"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "c = 2.;     \t\t\t#for 2 component system\n",
      "p = 4.;\n",
      "\n",
      "# Calculations\n",
      "d = c-p+2;\t\t\t#degree of freedom\n",
      "t = p*(c-1)+2;\t\t\t#no. of total variables\n",
      "\n",
      "# Results\n",
      "print \"D = C-P+2\"\n",
      "print \"Total no. of variables  =  P*(C-1)+2\"\n",
      "print \"Degree of freedom  =  \",d\n",
      "print \"when p  =  \",p\n",
      "print \"Two component system cannot have more than 4 phases in an equilibrium\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "D = C-P+2\n",
        "Total no. of variables  =  P*(C-1)+2\n",
        "Degree of freedom  =   0.0\n",
        "when p  =   4.0\n",
        "Two component system cannot have more than 4 phases in an equilibrium\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 10.2 page no : 257"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p_pb = 11364.1; \t    \t\t#density of lead in kg/m**3\n",
      "p_sn = 7220.14;\t    \t    \t#density of tin in kg/m**3\n",
      "\n",
      "# Calculations\n",
      "p_e = 100./((38./p_pb)+(62./p_sn));\t\t\t#density of eutectic composition at point D\n",
      "w = .88*p_e;\t    \t\t#in kgf\n",
      "w_pb = .38*w;\t\t    \t#of lead in kgf\n",
      "w_sn = .62*w;\t\t\t    #of tin in kgf\n",
      "p_b = 7300.;        \t\t#density in beta phase in kg/m**3\n",
      "w1 = .12*p_b;\t\t    \t#in kgf\n",
      "w1_pb = .03*w1;\t\t\t    #of lead in kgf\n",
      "w1_sn = .97*w1;\t\t\t    #of tin in kgf\n",
      "w2_pb = w_pb+w1_pb;\t\t\t#Total weight of lead in kgf\n",
      "w2_sn = w_sn+w1_sn;\t\t\t#Total weight of tin in kgf\n",
      "sn = (w2_sn/(w2_sn+w2_pb))*100;\n",
      "\n",
      "# Results\n",
      "print \"Density of eutectic composition at point D (in kg/m3)  =  %.1f kg/m**3\"%p_e\n",
      "print \"Total weight of lead (in kgf)  = %.2f kgf\"%w2_pb\n",
      "print \"Total weight of tin (in kgf)  =  %.1f kgf\"%w2_sn\n",
      "print \"%% of Sn  =  %.2f\"%sn\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Density of eutectic composition at point D (in kg/m3)  =  8381.6 kg/m**3\n",
        "Total weight of lead (in kgf)  = 2829.07 kgf\n",
        "Total weight of tin (in kgf)  =  5422.7 kgf\n",
        "% of Sn  =  65.72\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 10.4 pageno :  266"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "c_be = 100;\n",
      "c_e = 1.65;\n",
      "c_o = 10;\n",
      "\n",
      "# Calculations\n",
      "w = (c_be-c_o)/(c_be-c_e);\n",
      "\n",
      "# Results\n",
      "print \"weight fractions  =  %.3f\"%w\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "weight fractions  =  0.915\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 10.5 pageno : 267"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "#m be amount of tin\n",
      "w_sn = 900.;\t    \t\t#weight of tin\n",
      "w_pb = 1000.;\t\t    \t#weight of lead\n",
      "\n",
      "# Calculations\n",
      "m = ((w_pb*0.97)-w_sn)/(1-.97);\t\t\t#in grams\n",
      "m1 = m/1000.;\t\t\t                #maximum mass of tin in kgm\n",
      "\n",
      "# Results\n",
      "print \"Maximum weight of tin that can be added without changing systems temperature (in kgm)  =  %.2f kg\"%m1\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum weight of tin that can be added without changing systems temperature (in kgm)  =  2.33 kg\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 10.6 page no : 270"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "c = 0.83;\t\t\t#carbon\n",
      "f = 0.; \t\t\t#ferrite\n",
      "ce = 6.67;\t\t\t#cementite\n",
      "\n",
      "# Calculations\n",
      "w_a = (ce-c)/(ce-f);\n",
      "w_b = (c-f)/(ce-f);\n",
      "\n",
      "# Results\n",
      "print \"Weight fraction of errite  =  %.3f\"%w_a\n",
      "print \"Weight Fraction of Cementite  =  %.3f\"%w_b\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Weight fraction of errite  =  0.876\n",
        "Weight Fraction of Cementite  =  0.124\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}