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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 12:Thermodynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ex12.1:pg-413"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The work done by the gas is= -220.0 J\n"
]
}
],
"source": [
" #Example 12_1\n",
" \n",
" \n",
" #To find the work done by the gas\n",
"d1=800 #Units in meter**3\n",
"d2=500 #Units in meter**3\n",
"p1=5*10**5 #Units in Pa\n",
"w1=p1*(d1-d2)*10**-6 #Units in J\n",
"p2=2*10**5 #Units in Pa\n",
"d3=200*10**-6 #Units in meter**3\n",
"p3=3*10**5 #Units in Pa\n",
"w2=(p2*d3)+(0.5*p3*d3) #Units in J\n",
"print \"The work done by the gas is=\",round(-(w1+w2)),\" J\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ex12.2:pg-415"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The estimated Cv value of nitric acid is Cv= 693.0 J/Kg K\n"
]
}
],
"source": [
" #Example 12_2\n",
" \n",
" \n",
" #To estimate the Cv of nitric acid\n",
"r=8314 #Units in J/Kmol K\n",
"m=30 #Units in Kg/Kmol\n",
"Cv=2.5*(r/m) #Units in J/Kg K\n",
"print \"The estimated Cv value of nitric acid is Cv=\",round(Cv),\" J/Kg K\"\n",
" #in textbook the answer is printed wrong as Cv=690 J/Kg K correct answer is 692 J/Kg K\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ex12.3:pg-415"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The final temperature is T2= 886.0 K\n"
]
}
],
"source": [
" #Example 12_3\n",
" \n",
"import math \n",
" #To find the final temperature\n",
"t1=27 #units in Centigrade\n",
"t1=t1+273 #Units in K\n",
"gama=1.4 #Units in Constant\n",
"p1=1 #units in Pa\n",
"v1_v2=15 #Units of in ratio\n",
"logT2=math.log10(t1)-((gama-1)*(math.log10(p1)-math.log10(v1_v2)))\n",
"T2=10**logT2 #Uniys in K\n",
"print \"The final temperature is T2=\",round(T2),\" K\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ex12.4:pg-417## "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This type of process is termed as throttling process and described by the equation Delta U=- Delta W\n",
"\n",
"Where Delta W is the work done\n"
]
}
],
"source": [
" #Example 12_4\n",
" \n",
" \n",
" #To describe the Temperature changes of the gas\n",
"print \"This type of process is termed as throttling process and described by the equation Delta U=- Delta W\\n\"\n",
"print \"Where Delta W is the work done\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ex12.5:pg-418## "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The entropy is Delta S= 24.5 J/K\n"
]
}
],
"source": [
" #Example 12_5\n",
" \n",
" \n",
" #To findout by how much the entropy of the system changes\n",
"m=20 #Units in gm\n",
"alpha=80 #Units in cal/gm\n",
"t=4.184 #Units in J/Cal\n",
"Q=m*alpha*t #Units in J\n",
"T=273 #Units in K\n",
"S=Q/T #Units in J/K\n",
"print \"The entropy is Delta S=\",round(S,1),\" J/K\"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Ex12.6:pg-419## "
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The amount of Electricity is required is Delta W= 11666.0 J\n"
]
}
],
"source": [
" #Example 12_6\n",
" \n",
" \n",
" #To findout how much electricity is needed\n",
"Tc=278 #Units in K\n",
"Th=293 #Units in K\n",
"COP=Tc/(Th-Tc) #Units in ratio\n",
"Qc=210000 #Units in J\n",
"W=Qc/COP #Units in J\n",
"print \"The amount of Electricity is required is Delta W=\",round(W),\" J\"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|