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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
" Chapter 1 - The properties of gases"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example E1 - Pg 17"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the pressure in the glass flask\n",
"#Initialzation of variables\n",
"m=1.25 #g\n",
"MN2=28.02 #g/mol\n",
"T=20+273.15 #K\n",
"V=0.25#L\n",
"#Calculations\n",
"P=m*8.31451*T/(MN2*V)\n",
"#Results\n",
"print '%s %.1f %s' %('Pressure in the gas flask = ',P,'kPa')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Pressure in the gas flask = 434.9 kPa\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example I2 - Pg 19"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the partial pressures of Oxygen, Nitrogen and Argon\n",
"#Initialzation of variables\n",
"xN2=0.780\n",
"xO2=0.210\n",
"xAr=0.009\n",
"P=100 #kPa\n",
"#Calculations\n",
"PN2=xN2*P\n",
"PO2=xO2*P\n",
"PAr=xAr*P\n",
"#Results\n",
"print '%s %.1f' %('Partial pressure of Nitrogen(kPa) = ',PN2)\n",
"print '%s %.1f' %('\\n Partial pressure of Oxygen(kPa) = ',PO2)\n",
"print '%s %.1f' %('\\n Partial pressure of Argon(kPa) = ',PAr)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Partial pressure of Nitrogen(kPa) = 78.0\n",
"\n",
" Partial pressure of Oxygen(kPa) = 21.0\n",
"\n",
" Partial pressure of Argon(kPa) = 0.9\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example I3 - Pg 22"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the percentage loss of speed of air molecules\n",
"#Initialzation of variables\n",
"import math\n",
"T1=298. #K\n",
"T2=273. #K\n",
"#Calculations\n",
"factor=math.sqrt(T2/T1)\n",
"percentage=(1-factor)*100\n",
"#Results\n",
"print '%s %.3f' %('Factor by which speed is reduced = ',factor)\n",
"print '%s %d' %('Percentage loss of speed of air molecules = ',percentage)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Factor by which speed is reduced = 0.957\n",
"Percentage loss of speed of air molecules = 4\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example I4 - Pg 24"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the ratio of rates of effusion\n",
"#Initialzation of variables\n",
"import math\n",
"MH2=2.016 #g/mol\n",
"MCO2=44.01 #g/mol\n",
"#calculations\n",
"ratio=math.sqrt(MCO2/MH2)\n",
"#results\n",
"print '%s %.3f' %('ratio of rates of effusion = ',ratio)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"ratio of rates of effusion = 4.672\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example I5 - Pg 25"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the mean free path and collision frequency\n",
"#Initialzation of variables\n",
"import math\n",
"T=25+273. #K\n",
"sigma=0.4*math.pow(10,(-18)) #m^2\n",
"P=math.pow(10,5) #Pa\n",
"c=481.8 #m/sec\n",
"#Calculations\n",
"Lambda=8.31451*T/(math.pow(2,0.5) *6.022*math.pow(10,23) *sigma*P)\n",
"frequency=math.pow(2,0.5) *6.022*math.pow(10,23) *sigma*P*c/(8.31451*T)\n",
"#Results\n",
"print '%s %.1e %s' %('Mean free path =',Lambda,'m')\n",
"print '%s %.1e %s' %('\\n Collision frequency =',frequency,'m')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Mean free path = 7.3e-08 m\n",
"\n",
" Collision frequency = 6.6e+09 m\n"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
|