summaryrefslogtreecommitdiff
path: root/Materials_Science_and_Engineering/Chapter7.ipynb
blob: f6cbd6b8933386118e7f00c8501a7f1965972aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 07 : Phase Diagrams"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.1, Page No 149"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "c = 2.0     # number of components\n",
      "\n",
      "#Calculations\n",
      "for n in range(1,5):\n",
      "    p = (c-1) +2   # Total variables\n",
      "    f = c-n+2    # degree of freedom\n",
      "    print(\"Degree of freedom for two components when number of phases is %d is %d\" %(n, f))\n",
      "    \n",
      "#Results\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Degree of freedom for two components when number of phases is 1 is 3\n",
        "Degree of freedom for two components when number of phases is 2 is 2\n",
        "Degree of freedom for two components when number of phases is 3 is 1\n",
        "Degree of freedom for two components when number of phases is 4 is 0\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.2, Page No 152"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "p = 4.0\t\t# number of phases of system\n",
      "f = 0       # number of degree of system\n",
      "\n",
      "#Calculations\n",
      "C = f+p-1   # components number\n",
      "\n",
      "#Results\n",
      "print(\"Minimum number of components in system is %d\" %C)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum number of components in system is 3\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.3, Page No 160"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "L = 23.3 \t\t# % composition of L\n",
      "a = 3.5         # concentration of Nacl in sea water\n",
      "ice = 0         # % composition of ice\n",
      "\n",
      "#Calculations\n",
      "f_ice = (L-a)/(L-ice)\n",
      "\n",
      "#Results\n",
      "print(\"Fractional amount of pure water that can be extracted from sea water is %0.2f\" %f_ice)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Fractional amount of pure water that can be extracted from sea water is 0.85\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7.5 Page No 167"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#initialisation of variables\n",
      "a = 0 \t\t# limiting value\n",
      "b = 0.8     # limiting value\n",
      "c = 0.6     # percentage composition of carbon\n",
      "f = 0.88    # fraction of ferrite in a eutectoid steel\n",
      "\n",
      "#Calculations\n",
      "f_pro_alpha = (b-c)/(b-a)\n",
      "f_perlite = 1 - f_pro_alpha\n",
      "f_eut = f*f_perlite\n",
      "\n",
      "#Results\n",
      "print(\"Composition of proeutectoid ferrite is %0.2f\" %f_pro_alpha)\n",
      "print(\"Composition of eutectoid ferrite is %0.2f\" %f_eut)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Composition of proeutectoid ferrite is 0.25\n",
        "Composition of eutectoid ferrite is 0.66\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}