summaryrefslogtreecommitdiff
path: root/Thermodynamics_An_Engineering_Approach/Chapter3.ipynb
blob: 9830dbfb72e652ff75959dcc102aaf60b96ddc8a (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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3: Properties of Pure Substances"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-1 ,Page No.128"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given values\n",
      "m=50;#mass in kg\n",
      "T=90;#temperature in C\n",
      "\n",
      "#Values from Table A-4\n",
      "P=70.183;#in kPa\n",
      "v=0.001036;#in m^3/kg\n",
      "\n",
      "#Calculation\n",
      "V=m*v;#equating dimensions\n",
      "print'pressure is %f kPa'%round(P,3);\n",
      "print'total volumne of tank becomes %f m^3'%round(V,4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure is 70.183000 kPa\n",
        "total volumne of tank becomes 0.051800 m^3\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-2 ,Page No.128"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given values\n",
      "V=2.0;#volumne of saturated water vapor in ft^3\n",
      "P=50.0;#pressure in psia\n",
      "\n",
      "#Values from Table A-5E\n",
      "T=280.99;#in F\n",
      "v=8.5175;#in ft^3/lbm\n",
      "\n",
      "#caluclation\n",
      "m=V/v;#dimension analysis\n",
      "print'Temperature inside cylinder %f F'%round(T,2);\n",
      "print'mass of vapour inside cylinder %f lbm'%round(m,3);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature inside cylinder 280.990000 F\n",
        "mass of vapour inside cylinder 0.235000 lbm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-3 ,Page No.128"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Constants used\n",
      "Hfg=2257.5;#enthalpy of vaporization in kJ/kg\n",
      "\n",
      "#Given values\n",
      "m=200.0/1000;#mass converting in kg\n",
      "P=100;#Pressure at which process takes place in kPa\n",
      "\n",
      "#Values from Table A-5\n",
      "vg=1.6941;#specific vol of sat liq\n",
      "vf=0.001043;#specific vol of vapor\n",
      "\n",
      "#Caluclation\n",
      "vfg=vg-vf;\n",
      "V=m*vfg;\n",
      "print'the volume change %f m^3'%round(V,4);\n",
      "E=m*Hfg;\n",
      "print'amount of energy transferred to the water %f kJ'%round(E,1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the volume change 0.338600 m^3\n",
        "amount of energy transferred to the water 451.500000 kJ\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-4 ,Page No.131"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given values\n",
      "mt=10#mass of water in kg\n",
      "mf=8;#mass of water in liquid form in kg\n",
      "T=90;#temperature in C\n",
      "\n",
      "#Values from Table A-4\n",
      "P=70.183;#in kPa\n",
      "vf=0.001036;#in m^3\n",
      "vg=2.3593;#in m^3\n",
      "\n",
      "#Caluclation\n",
      "mg=mt-mf;\n",
      "V=mf*vf+mg*vg;# V= Vg + Vf\n",
      "print'the volume of the tank %f m^3'%round(V,2);\n",
      "print'the pressure in the tank %f kPa'%round(P,3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the volume of the tank 4.730000 m^3\n",
        "the pressure in the tank 70.183000 kPa\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-5 ,Page No.131"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given values\n",
      "m=4;#mass of refrigerant-134a in kg\n",
      "V=80.0/1000;#volumne converting into m^3\n",
      "P=160;#pressure in kPa\n",
      "\n",
      "#Values from Table A-12\n",
      "vf=0.0007437;\n",
      "vg=0.12348;\n",
      "T=-15.60;\n",
      "hf=31.21;\n",
      "hfg=209.90;\n",
      "\n",
      "#Caluclations\n",
      "v=V/m;\n",
      "#vg>v>vf therefore it is a saturated mix\n",
      "#hence temp will same as saturation temp\n",
      "print'the temperature %f celcius'%round(T,2)\n",
      "x=(v-vf)/(vg-vf);#x=vg/vfg i.e the dryness fraction\n",
      "print'the quality is %f'%round(x,3);\n",
      "h=hf+x*hfg;\n",
      "print'the enthalpy of the refrigerant %f kJ/kg'%round(h,1);\n",
      "mg=x*m;\n",
      "Vg=mg*vg;\n",
      "print'the volume occupied by the vapor phase %f m^3'%round(Vg,4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the temperature -15.600000 celcius\n",
        "the quality is 0.157000\n",
        "the enthalpy of the refrigerant 64.100000 kJ/kg\n",
        "the volume occupied by the vapor phase 0.077500 m^3\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-7 ,Page No.133"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given values\n",
      "P=0.5;#pressure in MPa\n",
      "h=2890.0;#enthaply in kJ/kg\n",
      "\n",
      "#from Table A\u20136\n",
      "#at P=0.5 MPa\n",
      "T1=200.0;\n",
      "h1=2855.8;\n",
      "T2=250;\n",
      "h2=2961.0;\n",
      "# we need linear interpolation \n",
      "\n",
      "#calculatiom\n",
      "#by interpolation we can say that\n",
      "#h=h1+(T-T1)/(T2-T1)*(h2-h1)\n",
      "#we have to find T\n",
      "T=(h-h1)/(h2-h1)*(T2-T1)+T1;\n",
      "print'temperature of water %f celcius'%round(T,1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "temperature of water 216.300000 celcius\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-8 ,Page No.134"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given values\n",
      "T=80;#temperature of compressed liquid water in C\n",
      "P=5;#pressure in KPa\n",
      "\n",
      "#from Table A\u20137\n",
      "#at compressed liq given conditions\n",
      "u=333.82;\n",
      "\n",
      "#from Table A-4\n",
      "#at saturation\n",
      "usat=334.97;\n",
      "\n",
      "#calcualtion\n",
      "e=(usat-u)/u*100;\n",
      "print'internal energy of compressed liquid water using data from the compressed liquid table %f kJ/kg '%round(u,2);\n",
      "print'internal energy of compressed liquid water using saturated liquid data %f kJ/kg '%round(usat,2);\n",
      "print'the error involved %f the second case'%round(e,2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "internal energy of compressed liquid water using data from the compressed liquid table 333.820000 kJ/kg \n",
        "internal energy of compressed liquid water using saturated liquid data 334.970000 kJ/kg \n",
        "the error involved 0.340000 the second case\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-9 ,Page No.135"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#part a\n",
      "print('Part a');\n",
      "\n",
      "#given values\n",
      "P=200;#in KPa\n",
      "x=0.6;\n",
      "\n",
      "#from Table A-5\n",
      "T=120.21;\n",
      "uf=504.50;\n",
      "ufg=2024.6;\n",
      "\n",
      "#calcualtions\n",
      "u=uf+(x*ufg);\n",
      "print'temperature %f Celcius '%round(T,2);\n",
      "print'internal energy %f kJ/kg'%round(u,2);\n",
      "print('saturated liquid\u2013vapor mixture at a pressure of 200 kPa');\n",
      "\n",
      "#part b\n",
      "print('Part b');\n",
      "\n",
      "#given values\n",
      "T=125;#in C\n",
      "u=1600;#in kJ/kg\n",
      "\n",
      "#from Table A\u20134\n",
      "uf=524.83;\n",
      "ug=2534.3;\n",
      "#ug>u>ufg so its aturated liquid\u2013vapor mixture\n",
      "P=232.23;\n",
      "\n",
      "#calculation\n",
      "ufg=ug-uf;\n",
      "x=(u-uf)/ufg;\n",
      "print'Pressure %f kPa'%round(P,2);\n",
      "print'x is %f'%round(x,3);\n",
      "print('saturated liquid\u2013vapor mixture at a temp of 125 of celcius');\n",
      "\n",
      "#part c\n",
      "print('Part c');\n",
      "\n",
      "#given values\n",
      "P=1000;#in kPa\n",
      "u=2950;#in kJ/kg\n",
      "\n",
      "#from Table A\u20136\n",
      "uf=761.39;\n",
      "ug=2582.8;\n",
      "#u>ug so its superheated steam\n",
      "T=395.2;\n",
      "\n",
      "#calculation\n",
      "print'temperature %f Celcius'%round(T,1);\n",
      "print('superheated vapor at 1MPa');\n",
      "\n",
      "#part d\n",
      "print('Part d');\n",
      "\n",
      "#given values\n",
      "T=75;#in C\n",
      "P=100;#in kPa\n",
      "\n",
      "#from Table A\u20135\n",
      "Tsat=151.83;\n",
      "#T<Tsat so it is a compressed liquid\n",
      "#the given pressure is much lower than the lowest pressure value in the compressed liquid table i.e 5 MPa\n",
      "#assuming, the compressed liquid as saturated liquid at the given temperature\n",
      "\n",
      "#from Table A-4\n",
      "u=313.99;\n",
      "print'Internal energy %f kJ/kg'%round(u,2);\n",
      "print('the compressed liquid condition');\n",
      "\n",
      "#Part e\n",
      "print('Part e');\n",
      "\n",
      "#given values\n",
      "P=850;#in kPa\n",
      "x=0;\n",
      "\n",
      "#x=0 therefore it is a saturateed liquid condition\n",
      "#from Table A-5\n",
      "T=172.94;\n",
      "u=731.00;\n",
      "print'temperature %f Celcius'%round(T,2);\n",
      "print'Internal energy %f kJ/kg'%round(u,2);\n",
      "print('saturateed liquid condition')\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Part a\n",
        "temperature 120.210000 Celcius \n",
        "internal energy 1719.260000 kJ/kg\n",
        "saturated liquid\u2013vapor mixture at a pressure of 200 kPa\n",
        "Part b\n",
        "Pressure 232.230000 kPa\n",
        "x is 0.535000\n",
        "saturated liquid\u2013vapor mixture at a temp of 125 of celcius\n",
        "Part c\n",
        "temperature 395.200000 Celcius\n",
        "superheated vapor at 1MPa\n",
        "Part d\n",
        "Internal energy 313.990000 kJ/kg\n",
        "the compressed liquid condition\n",
        "Part e\n",
        "temperature 172.940000 Celcius\n",
        "Internal energy 731.000000 kJ/kg\n",
        "saturateed liquid condition\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-10 ,Page No.139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#constants used\n",
      "R=0.287# in kPa m^3/kg K\n",
      "\n",
      "#given values\n",
      "l=4;#dimensions of room in m\n",
      "b=5;#dimensions of room in m\n",
      "h=6;#dimensions of room in m\n",
      "P=100.0;#pressure in kPa\n",
      "T=25+273.0;#temperature in Kelvin\n",
      "\n",
      "#calculation\n",
      "V=l*b*h;\n",
      "m=P*V/R/T;\n",
      "print'the mass of the air %f kg'%round(m,1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the mass of the air 140.300000 kg\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-11 ,Page No.142"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given values\n",
      "P=1;#pressure in MPa\n",
      "T=50+273;#tempearture converting into Kelvin\n",
      "vgiv=0.021796;#specific vol. given in m^3\n",
      "\n",
      "#from Table A-1\n",
      "R=0.0815;\n",
      "Pcr=4.059;\n",
      "Tcr=374.2;\n",
      "\n",
      "#calculation\n",
      "\n",
      "#Part A\n",
      "v1=R*T/(P*1000);\n",
      "print'specific volume of refrigerant-134a under the ideal-gas assumption %fm^3/kg'%round(v1,6);\n",
      "e=(v1-vgiv)/vgiv;\n",
      "print'an error of %f'%round(e,3);\n",
      "\n",
      "#Part B\n",
      "#determine Z from the compressibility chart, we will calculate the reduced pressure and temperature\n",
      "Pr=P/Pcr;\n",
      "Tr=T/Tcr;\n",
      "#from chart\n",
      "Z=0.84;\n",
      "v=Z*v1;\n",
      "print'specific volume of refrigerant-134a under the generalized compressibility chart %f m^3/kg'%round(v,6);\n",
      "e=(v-vgiv)/vgiv;\n",
      "print'an error of %f'%round(e,3);\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "specific volume of refrigerant-134a under the ideal-gas assumption 0.026325m^3/kg\n",
        "an error of 0.208000\n",
        "specific volume of refrigerant-134a under the generalized compressibility chart 0.022113 m^3/kg\n",
        "an error of 0.015000\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-12 ,Page No.143"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given values\n",
      "v=0.51431;\n",
      "T=600;\n",
      "\n",
      "#from Table A-1E\n",
      "R=0.5956;\n",
      "Pcr=3200;\n",
      "Tcr=1164.8;\n",
      "\n",
      "#calculation\n",
      "\n",
      "#Part A\n",
      "#from Table A-6E\n",
      "Pa=1000.0;#in psia\n",
      "print'from the steam tables %i psia'%Pa;\n",
      "\n",
      "#Part B\n",
      "T=1060;#converted into R from F\n",
      "Pb=R*T/v;\n",
      "print'from the ideal-gas equation %i psia'%round(Pb,0);\n",
      "e=(Pb-Pa)/Pa;\n",
      "print'treating the steam as an ideal gas would result in an error of %f'%round(e,3)\n",
      "\n",
      "#Part C\n",
      "#calculating the pseudo-reduced specific volume and the reduced temperature\n",
      "Vr=v/(R*Tcr/Pcr);\n",
      "Tr=T/Tcr;\n",
      "#from the compressibility chart\n",
      "Pr=0.33;\n",
      "P=Pr*Pcr;\n",
      "print'from the generalized compressibility chart %i psia'%P\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "from the steam tables 1000 psia\n",
        "from the ideal-gas equation 1228 psia\n",
        "treating the steam as an ideal gas would result in an error of 0.228000\n",
        "from the generalized compressibility chart 1056 psia\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-13 ,Page No.147"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Answer of part c-d are having slight difference due to approximation in molar volumne in the textbook which here is caluculated to the approximation of 7 decimal digits\n",
      "\n",
      "from math import exp\n",
      "\n",
      "#given values\n",
      "T=175.0;#temperature in C\n",
      "v=0.00375;#sp. volumne in m^3/kg\n",
      "Pex=10000;#experimentaion determination\n",
      "\n",
      "#from Table A-1\n",
      "R=0.2968# in kPa m^3/kg  K\n",
      "\n",
      "#calculating\n",
      "\n",
      "#Part-a\n",
      "P=R*T/v;\n",
      "print'using the ideal-gas equation of state %i kPa'%(round(P))\n",
      "e=(P-Pex)/Pex*100;\n",
      "print'error is %f percent'%e;\n",
      "\n",
      "#Part-b\n",
      "#van der Waals constants from Eq. 3-23\n",
      "a=0.175;\n",
      "b=0.00138;\n",
      "#from van der waal eq.\n",
      "P=R*T/(v-b)-a/v**2;\n",
      "print'using the van der Waals equation of state  is %i kPa'%(round(P));\n",
      "e=(P-Pex)/Pex*100;\n",
      "print'error is %f percent'%e;\n",
      "\n",
      "#Part-c\n",
      "#constants in the Beattie-Bridgeman equation from Table 3\u20134\n",
      "A=102.29;\n",
      "B=0.05378;\n",
      "c=4.2*10**4;\n",
      "Ru=8.314;#in kPa m^3/kmol K\n",
      "M=28.013;#molecular weight in kg/mol\n",
      "vb=M*v;#molar vol.\n",
      "P=(Ru*T)/(vb**2)*(1-((c)/(vb*T**3)))*(vb+B)-(A/vb**2);\n",
      "print'using the Beattie-Bridgeman equationis %i kPa'%(round(P));\n",
      "e=(P-Pex)/Pex*100;\n",
      "print'error is %f percent'%e;\n",
      "\n",
      "#Part-d\n",
      "#constants of Benedict-Webb-Rubin equation from Table 3\u20134\n",
      "a=2.54;\n",
      "b=0.002328;\n",
      "c=7.379*10**4;\n",
      "alp=1.272*10**-4;\n",
      "Ao=106.73;\n",
      "Bo=0.040704;\n",
      "Co=8.164*10**5;\n",
      "gam=0.0053;\n",
      "P=((Ru*T)/vb)+((Bo*Ru*T)-Ao-Co/T**2)/vb**2+(b*Ru*T-a)/vb**3+(a*alp/vb**6)+(c/((vb**3)*(T**2)))*(1 + (gam/vb**2))*exp(-gam/vb**2);\n",
      "print'using Benedict-Webb-Rubin equation %i kPa'%(round(P));\n",
      "e=(P-Pex)/Pex*100;\n",
      "print'error is %f percent'%e;\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "using the ideal-gas equation of state 13851 kPa\n",
        "error is 38.506667 percent\n",
        "using the van der Waals equation of state  is 9471 kPa\n",
        "error is -5.288326 percent\n",
        "using the Beattie-Bridgeman equationis 10109 kPa\n",
        "error is 1.092970 percent\n",
        "using Benedict-Webb-Rubin equation 10004 kPa\n",
        "error is 0.039256 percent\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3-14 ,Page No.152"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given value\n",
      "T=25;#air temperature over a lake in C\n",
      "\n",
      "#from table 3-1\n",
      "Psat=3.17;#in kPa\n",
      "\n",
      "#calculations\n",
      "\n",
      "#Relative Humidity 10%\n",
      "Pv1=0.1*Psat\n",
      "#Relative Humidity 80%\n",
      "Pv2=0.8*Psat\n",
      "#Relative Humidity 100%\n",
      "Pv3=1*Psat\n",
      "\n",
      "# from table 3-1 Tsat at these Pressures are\n",
      "T1=-8.0;\n",
      "T2=21.2;\n",
      "T3=25.0;\n",
      "print'with relative humidity 10, temperature is %i in C'%T1\n",
      "print'with relative humidity 80, temperature is %i in C'%T2\n",
      "print'with relative humidity 100, temperature is %i in C'%T3\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "with relative humidity 10, temperature is -8 in C\n",
        "with relative humidity 80, temperature is 21 in C\n",
        "with relative humidity 100, temperature is 25 in C\n"
       ]
      }
     ],
     "prompt_number": 15
    }
   ],
   "metadata": {}
  }
 ]
}