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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
{
"metadata": {
"name": "",
"signature": "sha256:163d017a43636b203253208922a2be0b72d9894b37f4d97c9da43a5e9b39c875"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 7 - Gases and Introductory stastical thermodynamics"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2 - pg 192"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the Gas constant\n",
"#Initialization of variables\n",
"h=76. #cm\n",
"d=13.5951 #g/cc\n",
"g=980.655 #cm/s^2\n",
"T=273.15 #K\n",
"v=22414.6 #cm^3 /mol\n",
"#calculations\n",
"P=h*d*g\n",
"R=P*v/(T)\n",
"#results\n",
"print '%s %.3e %s' %(\"Gas constant =\",R,\"ergs/deg. mol\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Gas constant = 8.315e+07 ergs/deg. mol\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 3 - pg 192"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the R value in calories\n",
"#Initialization of variables\n",
"cal=4.184*10**7 #ergs\n",
"R=8.315*10**7 #ergs/deg/mol\n",
"#calculations\n",
"Rdash=R/cal\n",
"#results\n",
"print '%s %.3f %s' %(\"R in calories =\",Rdash,\" cal/ deg mol\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"R in calories = 1.987 cal/ deg mol\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 4 - pg 192"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the root mean square velocity\n",
"#Initialization of variables\n",
"import math\n",
"from math import sqrt\n",
"R=8.315*10**7 #ergs/deg/mol\n",
"T=273.2 #deg\n",
"M=4 #g/mol\n",
"#calculations\n",
"u2=3*T*R/M\n",
"u=sqrt(u2)\n",
"#results\n",
"print '%s %.2e %s' %(\"root mean square velocity =\",u,\" cm/sec\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"root mean square velocity = 1.31e+05 cm/sec\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 5 - pg 194"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the Partial pressure of N2, O2 and CO2\n",
"#Initialization of variables\n",
"n1=2.\n",
"n2=10.\n",
"n3=3.\n",
"P=720. #mm of Hg\n",
"#calculations\n",
"n=n1+n2+n3\n",
"x1=n1/n\n",
"P1=x1*P\n",
"x2=n2/n\n",
"P2=x2*P\n",
"x3=n3/n\n",
"P3=x3*P\n",
"#results\n",
"print '%s %d %s' %(\"\\n Partial pressure of N2 =\",P1,\"mm\")\n",
"print '%s %d %s' %(\"\\n Partial pressure of O2 =\",P2,\" mm\")\n",
"print '%s %d %s' %(\"\\n Partial pressure of CO2 =\",P3,\"mm\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
" Partial pressure of N2 = 96 mm\n",
"\n",
" Partial pressure of O2 = 480 mm\n",
"\n",
" Partial pressure of CO2 = 144 mm\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 6 - pg 197"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the Total energy\n",
"#Initialization of variables\n",
"T=273.2+25 #K\n",
"n=1 #mol\n",
"R=1.987 #cal/deg mol\n",
"#calculations\n",
"Etr=1.5*n*R*T\n",
"Erot=1.5*n*R*T\n",
"Evib=0\n",
"Eel=0\n",
"Etot=Etr+Erot+Evib+Eel\n",
"#results\n",
"print '%s %d %s' %(\"Total energy =\",Etot,\"cal\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Total energy = 1777 cal\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 7 - pg 199"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the Molecular diameter of He\n",
"#Initialization of variables'\n",
"import math\n",
"b=24.1 #cm^2/mol\n",
"N=6.023*10**23 #mole^-1\n",
"#calculations\n",
"d=(3*b/(2*math.pi*N))**(1./3)\n",
"#results\n",
"print '%s %.2e %s' %(\"Molecular diameter of He =\",d,\" cm\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Molecular diameter of He = 2.67e-08 cm\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8 - pg 205"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the Volume\n",
"#Initialization of variables\n",
"P=100. #atm\n",
"T=200. #K\n",
"n=1. #mole\n",
"R=0.08206 #l atm/deg mol\n",
"print \"From psychrometric charts,\"\n",
"Tc=126.2 #K\n",
"Pc=33.5 #K\n",
"#calculations\n",
"Pr=P/Pc\n",
"Tr=T/Tc\n",
"print \"From z charts,\"\n",
"z=0.83\n",
"V=z*n*R*T/P\n",
"#results\n",
"print '%s %.3f %s' %(\"Volume =\",V,\" liter\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"From psychrometric charts,\n",
"From z charts,\n",
"Volume = 0.136 liter\n"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
|