summaryrefslogtreecommitdiff
path: root/Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10.ipynb
blob: cf4b44fb62b9efe33b24a860074ef0ab97c0a098 (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
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 10: Properties of gases and gas mixture"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.1:pg-366"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.1\n",
      "\n",
      "\n",
      " The final equilibrium pressure is  1.16869318853  MPa\n",
      "\n",
      " The amount of heat transferred to the surrounding is  -226.04503125  kJ\n",
      " \n",
      "\n",
      " If the vessel is perfectly insulated\n",
      "\n",
      " The final temperature is  45.4545454545  degree Celsius\n",
      "\n",
      " The final pressure is  1.24058552709  MPa\n"
     ]
    }
   ],
   "source": [
    "Pa = 1.5 # Pressure in vessel A in MPa\n",
    "Ta = 50  # Temperature in vessel A in K\n",
    "ca = 0.5 # Content in vessel A in kg mol\n",
    "Pb = 0.6 # Pressure in vessel B in MPa\n",
    "Tb = 20 # Temperature in vessel B in K\n",
    "mb = 2.5 # Content in vessel B in kg mol\n",
    "R = 8.3143 # Universal gas constant\n",
    "Va = (ca*R*(Ta+273))/(Pa*1e03) # volume of vessel A\n",
    "ma = ca*28 # mass of gas in vessel A\n",
    "Rn = R/28 # Gas content to of nitrogen\n",
    "Vb = (mb*Rn*(Tb+273))/(Pb*1e03) # volume of vessel B\n",
    "V = Va + Vb  # Total volume\n",
    "m = ma + mb # Total mass\n",
    "Tf = 27 # Equilibrium temperature in degree Celsius\n",
    "P = (m*Rn*(Tf+273))/V # Equilibrium pressure \n",
    "g = 1.4 # Heat capacity ratio\n",
    "cv  = Rn/(g-1) # Heat capacity at constant volume\n",
    "U1 = cv*(ma*Ta+mb*Tb) # Initial internal energy \n",
    "U2 = m*cv*Tf# Final internal energy \n",
    "Q = U2-U1 # heat transferred\n",
    "\n",
    "print \"\\n Example 10.1\"\n",
    "print \"\\n\\n The final equilibrium pressure is \",P/1e3 ,\" MPa\"\n",
    "print \"\\n The amount of heat transferred to the surrounding is \",Q ,\" kJ\"\n",
    "#The answers vary due to round off error\n",
    "\n",
    "T_ = (ma*Ta+mb*Tb)/m  # final temperature\n",
    "P_ = (m*Rn*(T_+273))/V # final pressure\n",
    "print \" \\n\\n If the vessel is perfectly insulated\"\n",
    "print \"\\n The final temperature is \",T_ ,\" degree Celsius\"\n",
    "print \"\\n The final pressure is \",P_/1e3 ,\" MPa\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.2:pg-368"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.2\n",
      "\n",
      "\n",
      " Gas constant of the gas is  0.461  kJ/kg K \n",
      "\n",
      " Molecular weight the gas is  18.0347071584  kg/kg mol\n",
      "\n",
      " The heat transfer at constant volume is  286.33  kJ\n",
      "\n",
      " Work done is  0  kJ\n",
      "\n",
      " The change in internal energy is  286.33  kJ\n",
      "\n",
      " The change in  enthalpy is  373.92  kJ\n",
      "\n",
      " The change in  entropy is  0.0  kJ/k\n"
     ]
    }
   ],
   "source": [
    "\n",
    "cp = 1.968 # Heat capacity in kJ/kg\n",
    "cv = 1.507 # Heat capacity in kJ/kg\n",
    "R_ = 8.314 # Gas constant\n",
    "V = 0.3 # Volume of chamber in m**3\n",
    "m = 2 # mass of gas in kg\n",
    "T1 = 5# Initial gas temperature in degree Celsius\n",
    "T2 = 100 # Final gas temperature in degree Celsius\n",
    "R = cp-cv # Universal gas constant\n",
    "mu = R_/R # molecular weight\n",
    "Q12 = m*cv*(T2-T1) # The heat transfer at constant volume\n",
    "W12 = 0 # work done\n",
    "U21 = Q12 # change in internal energy\n",
    "H21= m*cp*(T2-T1) # change in  enthalpy\n",
    "S21 = m*cv*math.log((T2+273)/(T1+273)) #change in  entropy \n",
    "\n",
    "print \"\\n Example 10.2\"\n",
    "print \"\\n\\n Gas constant of the gas is \",R ,\" kJ/kg K \"\n",
    "print \"\\n Molecular weight the gas is \",mu ,\" kg/kg mol\"\n",
    "print \"\\n The heat transfer at constant volume is \",Q12 ,\" kJ\"\n",
    "print \"\\n Work done is \",0 ,\" kJ\"\n",
    "print \"\\n The change in internal energy is \",U21 ,\" kJ\"\n",
    "print \"\\n The change in  enthalpy is \",H21 ,\" kJ\"\n",
    "print \"\\n The change in  entropy is \",S21 ,\" kJ/k\"\n",
    "#The answers vary due to round off error\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.3:pg-369"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.3\n",
      "\n",
      " The work done in the expansion is  300.72200185  kJ\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "from scipy import integrate\n",
    "m = 1.5 # Mass of gas in kg\n",
    "P1 = 5.6 # Initial pressure of gas in MPa\n",
    "V1 = 0.06 # Initial volume of gas in m**3\n",
    "T2_ = 240 # Final temperature of gas in degree Celsius\n",
    "a = 0.946 # Constant\n",
    "b = 0.662 # Constant\n",
    "k = 1e-4 # Constant\n",
    "# Part (b)\n",
    "R = a-b # constant\n",
    "T2 = T2_+273 # Final temperature of gas in KK\n",
    "T1 = (P1*1e03*V1)/(m*R) # Initial temperature\n",
    "W12,er =integrate.quad(lambda T:m*(b+k*T),T1,T2) # Work done\n",
    "\n",
    "print \"\\n Example 10.3\"\n",
    "print \"\\n The work done in the expansion is \",-W12 ,\" kJ\"\n",
    "#The answers vary due to round off error\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.5:pg-371"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.5\n",
      "\n",
      " The work transfer for the whole path is  93.4986082985  kJ\n",
      "\n",
      " The heat transfer for the whole path  571.638005316  kJ\n"
     ]
    }
   ],
   "source": [
    "\n",
    "m = 0.5 # mass of air in kg\n",
    "P1 = 80 # Initial pressure kPa\n",
    "T1 = 60 # Initial temperature in degree Celsius\n",
    "P2 = 0.4 # Final pressure in MPa\n",
    "R = 0.287 # Gas constant\n",
    "V1 = (m*R*(T1+273))/(P1) # Volume of air at state 1\n",
    "g = 1.4 # Heat capacity ratio\n",
    "T2 = (T1+273)*(P2*1e3/P1)**((g-1)/g)# Final temperature\n",
    "W12 = (m*R*(T1+273-T2))/(g-1) # Work done in \n",
    "V2 = V1*((P1/(P2*1e3))**(1/g)) # Final volume\n",
    "W23 = P2*(V1-V2)*1e3 # # Work done\n",
    "W = W12+W23 # Net work done\n",
    "V3 = V1 # constant volume\n",
    "T3 = (T2)*(V3/V2) # Temperature at state 3\n",
    "cp = 1.005 # Heat capacity at constant volume in kJ/kgK\n",
    "Q = m*cp*(T3-T2)# Heat transfer\n",
    "print \"\\n Example 10.5\"\n",
    "print \"\\n The work transfer for the whole path is \",W ,\" kJ\"\n",
    "#The answers vary due to round off error\n",
    "print \"\\n The heat transfer for the whole path \",Q ,\" kJ\"\n",
    "#The answer provided in the textbook is wrong\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.6:pg-372"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.6\n",
      "\n",
      " The heat received in the cycle is  137.268292683  kJ\n",
      "\n",
      " The heat rejected in the cycle  84.2666952566  kJ\n",
      "\n",
      " The efficiency of the cycle is  39.0  percent\n"
     ]
    }
   ],
   "source": [
    "P1 = 700 # Initial pressure of gas in kPa\n",
    "T1 = 260 # Initial temperature of gas in degree Celcius \n",
    "T3 = T1 # Temperature at state 3\n",
    "V1 = 0.028 # Initial volume of gas in m**3\n",
    "V2 = 0.084 # Final volume of gas in m**3\n",
    "R = 0.287 # Gas constant\n",
    "m = (P1*V1)/(R*(T1+273)) # mass of gas  \n",
    "P2 = P1 # Pressure at state 2\n",
    "T2 = (T1+273)*((P2*V2)/(P1*V1)) # Temperature at state 2\n",
    "n  = 1.5 # polytropic index \n",
    "P3 = P2*(((T3+273)/(T2))**(n/(n-1))) # Pressure at state 3\n",
    "cp = 1.005 # COnstant pressure heat capacity in kJ/kgK\n",
    "cv = 0.718 # COnstant volume heat capacity in kJ/kgK\n",
    "Q12 = m*cp*(T2-T1-273) # HEat transfer\n",
    "Q23 = m*cv*(T3+273-T2) + (m*R*(T2-T3-273))/(n-1) # Heat transfer\n",
    "Q31 = m*R*(T1+273)*math.log(P3/P2) # Heat transfer\n",
    "Q1 = Q12 # Heat equivalance\n",
    "Q2 = -(Q23+Q31) # Net heat transfer\n",
    "e = 1-(Q2/Q1) # First law efficiency\n",
    "\n",
    "print \"\\n Example 10.6\"\n",
    "print \"\\n The heat received in the cycle is \",Q1 ,\" kJ\"\n",
    "print \"\\n The heat rejected in the cycle \",Q2 ,\" kJ\"\n",
    "print \"\\n The efficiency of the cycle is \",math. ceil(e*100) ,\" percent\"\n",
    "#The answers vary due to round off error"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.7:pg-374"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.7\n",
      "\n",
      " Cv of the gas is  0.661000944287  kJ/kg K\n",
      "\n",
      " Cp of the gas is  0.89896128423  kJ/kg K\n",
      "\n",
      " Increase in the entropy of the gas is  0.080159241414  kJ/kg K\n"
     ]
    }
   ],
   "source": [
    "\n",
    "P1 = 300 # Initial gas pressure in kPa\n",
    "V1 = 0.07 # Initial volume of gas in m**3\n",
    "m = 0.25 # Mass of gas in kg\n",
    "T1 = 80 # Initial temperature of gas in degree Celsius\n",
    "R = (P1*V1)/(m*(T1+273)) # constant\n",
    "P2 = P1 # process condition\n",
    "V2 = 0.1 # Final volume in m**3\n",
    "T2 = (P2*V2)/(m*R) # Final temperature in K\n",
    "W = -25 #Work done in kJ\n",
    "cv = -W/(m*(T2-T1-273)) # Constant volume heat capacity in kJ/kg\n",
    "cp = R+cv #Constant pressure heat capacity in kJ/kg\n",
    "S21 = m*cp*math.log(V2/V1) # Entropy change\n",
    "print \"\\n Example 10.7\"\n",
    "print \"\\n Cv of the gas is \",cv ,\" kJ/kg K\"\n",
    "print \"\\n Cp of the gas is \",cp ,\" kJ/kg K\"\n",
    "print \"\\n Increase in the entropy of the gas is \",S21 ,\" kJ/kg K\"\n",
    "#The answers vary due to round off error\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.8:pg-374"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.8\n",
      "\n",
      "\n",
      " Mole fraction of N2 is  0.485294117647\n",
      "\n",
      " Mole fraction of CO2  is  0.514705882353\n",
      "\n",
      " Equivalent molecular weight of mixture is  36.2352941176 kg/kg mol\n",
      "\n",
      "\n",
      " The equivalent gas constant of the mixture is  0.229444805195  kJ/kg K\n",
      "\n",
      "\n",
      " Partial pressures of nitrogen and CO2 are \n",
      "  145.588235294  kPa and  154.411764706  kPa respectively\n",
      "\n",
      " Partial volume of nitrogen and CO2 are \n",
      "  0.870000714286  kPa and  0.922728030303  kPa respectively\n",
      "\n",
      "\n",
      " Total volume of mixture is  1.79272874459  m**3\n",
      "\n",
      " Density of mixture is  4.46247098126  kg/m**3\n",
      "\n",
      "\n",
      " Cp and Cv of mixture are \n",
      "  0.920740483948 kJ/kg K and  0.691295678753 kJ/kg K respectively\n",
      "\n",
      "\n",
      " Change in internal energy of the system heated at constant volume  is  110.6073086 kJ\n",
      "\n",
      " Change in enthalpy of the system heated at constant volume  is  147.318477432 kJ\n",
      "\n",
      " Change in entropy of the system heated at constant volume  is  0.36517324538  kJ/kg K\n",
      "\n",
      "\n",
      " Change in entropy of the system heated at constant Pressure  is  0.486376236695 kJ/kgK\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "mn = 3.0 # Mass of nitrogen in kg\n",
    "mc = 5.0 # mass of CO2 in kg\n",
    "an = 28.0 # Atomic weight of nitrogen\n",
    "ac = 44.0 # Atomic weight of CO2\n",
    "# Part (a)\n",
    "xn = (mn/an)/((mn/an)+(mc/ac)) # mole fraction of nitrogen\n",
    "xc = (mc/ac)/((mn/an)+(mc/ac)) # mole fraction of carbon\n",
    "\n",
    "print \"\\n Example 10.8\"\n",
    "print \"\\n\\n Mole fraction of N2 is \",xn \n",
    "print \"\\n Mole fraction of CO2  is \",xc\n",
    "#The answers vary due to round off error\n",
    "\n",
    "# Part (b)\n",
    "M = xn*an+xc*ac # Equivalent molecular weight\n",
    "print \"\\n Equivalent molecular weight of mixture is \",M ,\"kg/kg mol\" \n",
    "\n",
    "# Part (c)\n",
    "R = 8.314 # Gas constant\n",
    "Req = ((mn*R/an)+(mc*R/ac))/(mn+mc)\n",
    "print \"\\n\\n The equivalent gas constant of the mixture is \",Req ,\" kJ/kg K\" \n",
    "\n",
    "# Part (d)\n",
    "P = 300.0 # Initial pressure in kPa\n",
    "T = 20.0 # Initial temperature in degree Celsius\n",
    "Pn = xn*P # Partial pressure of Nitrogen\n",
    "Pc = xc*P # Partial pressure of CO2 \n",
    "Vn = (mn*R*(T+273))/(P*an) # Volume of nitrogen\n",
    "Vc = (mc*R*(T+273))/(P*ac) # Volume of CO2\n",
    "print \"\\n\\n Partial pressures of nitrogen and CO2 are \\n \",Pn ,\" kPa and \",Pc ,\" kPa respectively\"\n",
    "print \"\\n Partial volume of nitrogen and CO2 are \\n \",Vn ,\" kPa and \",Vc ,\" kPa respectively\"\n",
    "# Part (e)\n",
    "V = (mn+mc)*Req*(T+273)/P # Total volume\n",
    "rho = (mn+mc)/V # mass density\n",
    "print \"\\n\\n Total volume of mixture is \",V ,\" m**3\" \n",
    "print \"\\n Density of mixture is \",rho ,\" kg/m**3\" \n",
    "\n",
    "# Part (f)\n",
    "gn = 1.4 # Heat capacity ratio for nitrogen\n",
    "gc = 1.286 # Heat capacity ratio for carbon dioxide \n",
    "cvn = R/((gn-1)*an) # cp and cv of N2\n",
    "cpn = gn*cvn  # Constant pressure heat capacity of nitrogen\n",
    "cvc = R/((gc-1)*ac) # cp and cv of CO2\n",
    "cpc = gc*cvc# COnstant pressure heat capacity of carbon dioxide \n",
    "cp = (mn*cpn+mc*cpc)/(mn+mc)  # Constant pressure heat capacity ratio of mixture\n",
    "cv = (mn*cvn+mc*cvc)/(mn+mc) # Constant volume Heat capacity ratio of mixture\n",
    "print \"\\n\\n Cp and Cv of mixture are \\n \",cp ,\"kJ/kg K and \",cv ,\"kJ/kg K respectively\" \n",
    "T1 = T \n",
    "T2 = 40 \n",
    "U21 = (mn+mc)*cv*(T2-T1)\n",
    "H21 = (mn+mc)*cp*(T2-T1)\n",
    "S21v = (mn+mc)*cv*math.log((T2+273)/(T1+273)) # If heated at constant volume\n",
    "S21p = (mn+mc)*cp*math.log((T2+273)/(T1+273)) # If heated at constant Pressure\n",
    "\n",
    "print \"\\n\\n Change in internal energy of the system heated at constant volume  is \",U21 ,\"kJ\" \n",
    "print \"\\n Change in enthalpy of the system heated at constant volume  is \",H21 ,\"kJ\" \n",
    "print \"\\n Change in entropy of the system heated at constant volume  is \",S21v ,\" kJ/kg K\"\n",
    "print \"\\n\\n Change in entropy of the system heated at constant Pressure  is \",S21p ,\"kJ/kgK\" \n",
    "\n",
    "#The answers vary due to round off error\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.9:pg-375"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.9\n",
      "\n",
      " Increase in entropy is  1.22920562691  kJ/kg K\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "mo = 2.0 # mass of oxygen in kg\n",
    "mn = 6.0 # mass of nitrogen in kg\n",
    "muo = 32.0 # molecular mass of oxygen\n",
    "mun = 28.0 # molecular mass of nitrogen\n",
    "o = mo/muo # mass fraction of oxygen\n",
    "n = mn/mun # mass fraction of nitrogen\n",
    "xo = o/(n+o) # mole fraction of oxygen\n",
    "xn = n/(n+o) # mole fraction of nitrogen\n",
    "R = 8.314 # Universal gas constant\n",
    "Ro = R/muo # Gas constant for oxygen\n",
    "Rn = R/mun # Gas constant for nitrogen\n",
    "dS = -mo*Ro*math.log(xo)-mn*Rn*math.log(xn) # Increase in entropy \n",
    "\n",
    "print \"\\n Example 10.9\"\n",
    "print \"\\n Increase in entropy is \",dS ,\" kJ/kg K\"\n",
    "#The answers vary due to round off error\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Ex10.10:pg-376"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      " Example 10.10\n",
      "\n",
      " Specific volume is  3.05515367719  *10**-3 m3/kg\n",
      "\n",
      " Specific temperature is  57.85  K\n",
      "\n",
      " Specific pressure is  5.46  MPa\n",
      "\n",
      " Reduced volume is  1.48226362179  m3/kg\n"
     ]
    }
   ],
   "source": [
    "\n",
    "an = 20.183 # molecular weight of neon\n",
    "Pc = 2.73 # Critical pressure\n",
    "Tc = 44.5 # Critical tmperature in Kelvin\n",
    "Vc = 0.0416 # volume of gas in m**3\n",
    "Pr = 2 # Reduced Pressure\n",
    "Tr = 1.3 # Reduced temperature\n",
    "Z = 0.7 # Compressibility factor\n",
    "P = Pr*Pc # Corresponding Pressure \n",
    "T = Tr*Tc # Corresponding temperature\n",
    "R = 8.314 # Gas constant\n",
    "v = (Z*R*T)/(P*an) # Corresponding volume\n",
    "vr = (v*an)/(Vc*1e3)  # reduced volume\n",
    "\n",
    "print \"\\n Example 10.10\"\n",
    "print \"\\n Specific volume is \",v ,\" *10**-3 m3/kg\"\n",
    "print \"\\n Specific temperature is \",T ,\" K\"\n",
    "print \"\\n Specific pressure is \",P ,\" MPa\"\n",
    "print \"\\n Reduced volume is \",vr ,\" m3/kg\"\n",
    "#The answers vary due to round off error\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
}