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
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 1 : Introduction"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.1 page number 19"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"y_oxygen = 0.21 #mole fraction of oxygen\n",
"y_nitrogen = 0.79 #mole fraction of nitrogen\n",
"molar_mass_oxygen = 32.\n",
"molar_mass_nitrogen = 28.\n",
"\n",
"molar_mass_air = y_oxygen*molar_mass_oxygen+y_nitrogen*molar_mass_nitrogen;\n",
"mass_fraction_oxygen =y_oxygen*molar_mass_oxygen/molar_mass_air;\n",
"mass_fraction_nitrogen = y_nitrogen*molar_mass_nitrogen/molar_mass_air;\n",
"\n",
"print \"mass fraction of oxygen = %f \"%(mass_fraction_oxygen)\n",
"print \"mass fraction of nitrogen = %f \"%(mass_fraction_nitrogen)\n",
"\n",
"V1 = 22.4 #in liters\n",
"P1 = 760. #in mm Hg\n",
"P2= 735.56 #in mm Hg\n",
"T1= 273. #in K\n",
"T2 = 298. #in K\n",
"\n",
"V2= (P1*T2*V1)/(P2*T1);\n",
"density = molar_mass_air/V2;\n",
"\n",
"print \"density = %f gm/l\"%(density)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"mass fraction of oxygen = 0.233010 \n",
"mass fraction of nitrogen = 0.766990 \n",
"density = 1.141558 gm/l\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.2 page number 20\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"mass_propane=14.2 #in kg\n",
"molar_mass=44 #in kg\n",
"\n",
"moles=(mass_propane*1000)/molar_mass;\n",
"volume=22.4*moles; #in liters\n",
"\n",
"print \"volume = %d liters\"%(volume)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"volume = 7229 liters\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.3 page number 20\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"y_CO2 = 0.25;\n",
"y_CO = 0.002;\n",
"y_SO2 = 0.012;\n",
"y_N2 = 0.680;\n",
"y_O2 = 0.056;\n",
"\n",
"Mm = y_CO2*44+y_CO*28+y_SO2*64+y_N2*28+y_O2*32;\n",
"print \" molar mass = %d \"%(Mm)\n",
"\n",
"print \" finding weight composition \"\n",
"w_CO2 = y_CO2*44*100/Mm;\n",
"print \" weight_CO2 = %f \"%(w_CO2)\n",
"w_CO = y_CO*28*100/Mm;\n",
"print \"weight_CO = %f \"%(w_CO)\n",
"w_SO2 = y_SO2*64*100/Mm;\n",
"print \"weight_SO2 = %f \"%( w_SO2)\n",
"w_N2 = y_N2*28*100/Mm;\n",
"print \"weight_N2 = %f \"%( w_N2)\n",
"w_O2 = y_O2*32*100/Mm;\n",
"print \"weight_O2 = %f \"%( w_O2)\n",
"\n",
"print \"if SO2 is removed \"\n",
"v_CO2 = 25;\n",
"v_CO = 0.2;\n",
"v_N2 = 68.0;\n",
"v_O2 = 5.6;\n",
"v = v_CO2+v_CO+v_N2+v_O2;\n",
"v1_CO2 = (v_CO2*100/98.8);\n",
"\n",
"print \"volume_CO2 = %f \"%( v1_CO2)\n",
"v1_CO = (v_CO*100/98.8);\n",
"print \"volume_CO = %f \"%(v1_CO)\n",
"v1_N2 = (v_N2*100/98.8);\n",
"print \"volume_N2 = %f \"%(v1_N2)\n",
"v1_O2 = (v_O2*100/98.8);\n",
"print \"volume_O2 = %f \"%(v1_O2 )\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" molar mass = 32 \n",
" finding weight composition \n",
" weight_CO2 = 33.684468 \n",
"weight_CO = 0.171485 \n",
"weight_SO2 = 2.351788 \n",
"weight_N2 = 58.304753 \n",
"weight_O2 = 5.487506 \n",
"if SO2 is removed \n",
"volume_CO2 = 25.303644 \n",
"volume_CO = 0.202429 \n",
"volume_N2 = 68.825911 \n",
"volume_O2 = 5.668016 \n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.4 page number 24\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"p=1. #atm\n",
"H=2.7 #atm\n",
"\n",
"x=p/H;\n",
"\n",
"mole_ratio = (x)/(1-x);\n",
"moles_of_water=(100*1000)/18.;\n",
"moles_of_NH3=mole_ratio*moles_of_water;\n",
"\n",
"print \"moles of NH3 dissolved = %f\"%(moles_of_NH3)\n",
"\n",
"volume_NH3=(moles_of_NH3*22.4*293)/273;\n",
"print \"volume of NH3 dissolved = %f liters\"%(volume_NH3)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"moles of NH3 dissolved = 3267.973856\n",
"volume of NH3 dissolved = 78565.443271 liters\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.5 page number 24\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"p=746 #in mm Hg\n",
"H=1.08*10**6 #in mm Hg, Henry's constant\n",
"\n",
"x= p/H; #mole fraction of CO2\n",
"X=x*(44./18); #mass ratio of CO2 in water\n",
"\n",
"initial_CO2 = 0.005; #kg CO2/kg H20\n",
"G=1000*(initial_CO2-X);\n",
"\n",
"print \"CO2 given up by 1 cubic meter of water = %f kg CO2/cubic meter H20\"%(G)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CO2 given up by 1 cubic meter of water = 3.311523 kg CO2/cubic meter H20\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.6 page number 27 \n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"pa1 = 23.6; #VP of ethyl alchohal at 10 degree C\n",
"pa3=760. #VP of ethyl alchohal at 78.3 degree C in mm Hg\n",
"pb1 = 9.2 #VP of ethyl water at 10 degree C in mm Hg\n",
"pb3=332. #VP of ethyl water at 78.3 degree C in mm Hg\n",
"\n",
"C=(math.log10(pa1/pa3)/(math.log10(pb1/pb3)));\n",
"\n",
"pb2=149. #VP of water at 60 degree C in mm Hg\n",
"\n",
"pas=(pb3/pb2);\n",
"pa=C*math.log10(pas);\n",
"pa2=pa3/(10**pa);\n",
"\n",
"print \"vapor pressure of ethyl alcholoh at 60 degree C = %f mm Hg\"%(pa2)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"vapor pressure of ethyl alcholoh at 60 degree C = 349.872551 mm Hg\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.7 page number 28 \n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"t1 = 41. #in degree C\n",
"t2=59. #in degree C\n",
"theta_1 =83. #in degree C\n",
"theta_2=100. #in degree C\n",
"\n",
"K = (t1-t2)/(theta_1-theta_2);\n",
"t=59+(K*(104.2-100));\n",
"\n",
"print \"boiling point of SCl2 at 880 Torr = %f degree celcius\"%(t)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"boiling point of SCl2 at 880 Torr = 63.447059 degree celcius\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.8 page number 29\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"vp_C6H6 = 520. #in torr\n",
"vp_H2O = 225. #in torr\n",
"mass_water=18.\n",
"mass_benzene=78.\n",
"\n",
"amount_of_steam = (vp_H2O/vp_C6H6)/(mass_benzene/mass_water);\n",
"\n",
"print \"amount of steam = %f\"%( amount_of_steam)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"amount of steam = 0.099852\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.9 page number 30\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"p0b = 385. #vapor pressue of benzene at 60 degree C in torr\n",
"p0t=140. #vapor pressue of toluene at 60 degree C in torr\n",
"xb=0.4;\n",
"xt=0.6;\n",
"\n",
"pb=p0b*xb;\n",
"pt=p0t*xt;\n",
"P=pb+pt;\n",
"\n",
"print \"total pressure = %.0f torr\"%(P)\n",
"\n",
"yb=pb/P;\n",
"yt=pt/P;\n",
"print \"vapor composition of benzene = %f vapor composition of toluene = %f\"%(yb,yt)\n",
"\n",
"x=(760.-408)/(1013-408);\n",
"print \"mole fraction of benzene in liquid mixture = %.3f mole fraction of toluene in liquid mixture= %.3f\"%(x,1-x)\n",
"print \"Thus, the liquid mixture contained %.1f mole %% benzene and %.1f mole %% toluene\"%(x*100,(1-x)*100)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"total pressure = 238 torr\n",
"vapor composition of benzene = 0.647059 vapor composition of toluene = 0.352941\n",
"mole fraction of benzene in liquid mixture = 0.582 mole fraction of toluene in liquid mixture= 0.418\n",
"Thus, the liquid mixture contained 58.2 mole % benzene and 41.8 mole % toluene\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.10 page number 33\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"sigma_x=23.393;\n",
"sigma_y=-12.437;\n",
"sigma_x2=91.456\n",
"sigma_xy=-48.554;\n",
"\n",
"m=((6*sigma_xy)-(sigma_x*sigma_y))/(6*sigma_x2-(sigma_x)**2);\n",
"print \"m = %f \"%(m)\n",
"\n",
"c=((sigma_x2*sigma_y)-(sigma_xy*sigma_x))/(6*sigma_x2-(sigma_x)**2);\n",
"print \"c = %f \"%(c)\n",
"\n",
"print \"f=0.084*Re**-0.256\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"m = -0.256233 \n",
"c = -1.073825 \n",
"f=0.084*Re**-0.256\n"
]
}
],
"prompt_number": 21
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.11 page number 35\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"from numpy import *\n",
"from matplotlib.pyplot import * \n",
"\n",
"%matplotlib inline\n",
"\n",
"u = array([2,1.92,1.68,1.28,0.72,0]);\n",
"r = array([0,1,2,3,4,5]);\n",
"\n",
"z = u*r;\n",
"plot(r,z)\n",
"suptitle(\"variation of ur with r\")\n",
"xlabel(\"r\")\n",
"ylabel(\"ur\")\n",
"show()\n",
"u_avg = (2./25)*12.4\n",
"\n",
"print \"average velocity = %f cm/s\"%(u_avg)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Populating the interactive namespace from numpy and matplotlib\n"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"WARNING: pylab import has clobbered these variables: ['draw_if_interactive', 'new_figure_manager']\n",
"`%pylab --no-import-all` prevents importing * from pylab and numpy\n"
]
},
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEbCAYAAAA21FQWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X9UlHW+B/D3CKzugKJ2F9oGSguuMQrM+Ast0EEz/Mnq\nmqdwVUot4mpqtp3y3r0GJ1I7Uh5T15Xa3LVfutItZ2tk1zYmRURWw+rYD7EcmwGDiFDJHyDz3D8m\nRkYGGOCZeZ6Z5/06p3MYeWbmI9XHr5/5zHtUgiAIICIiRegjdQFEROQ7bPpERArCpk9EpCBs+kRE\nCsKmT0SkIGz6REQKwqZPsjNjxgxcuHCh02vWrVvncvvuu+/2Zkn48ssvodPpMGrUKJw5c8arzwUA\n1dXVmDdvHgDgk08+wf79+53fy8nJwQsvvOD1GigwsemTbAiCAEEQ8P7772PAgAGdXrt+/XqX24cP\nH/ZmaXj33Xcxb948HD9+HEOHDu32/VtaWrp1/S233IK9e/cCACoqKmAymZzfU6lU3X5+u93e7ftQ\nYGLTJ1GtWbMGf/zjH523W0+lP/30E+655x6MGjUKC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ux06\nnQ6RkZFITU2FVquVuiRJPP7449i4cSP69JFVG5OMSqXCPffcg9GjR+Pll1/u8DpZ/bQ83fUnZWps\nbMR9992HzZs3IywsTOpyJNOnTx+cOHECNpsNBw8eVGQMwXvvvYeIiAjo9Xqe8n92+PBhVFRUYP/+\n/di2bRsOHTrk9jpZNX1Pdv1JmZqbmzF37lwsWLAAs2fPlrocWQgPD8eMGTNw7NgxqUvxudLSUhiN\nRgwdOhQZGRn48MMPsWjRIqnLktSvf/1rAMCvfvUrzJkzp8MXcmXV9D3Z9SflEQQBS5YsgVarxapV\nq6QuR1J1dXVoaGgAAFy+fBkHDhyAXq+XuCrfW7duHaxWK86cOYPdu3dj0qRJzvcAKdGlS5dw8eJF\nAMBPP/2Ef/7zn4iPj3d7rayafttdf61Wi/vvv1+xGxoZGRm46667cOrUKURHRyv6PQ2HDx/G66+/\njuLiYuj1euj1ehQVFUldliTOnTuHSZMmQafTISkpCbNmzcLkyZOlLktySh8N19TUICUlxfnfxcyZ\nM3Hvvfe6vVZWK5tERORdsjrpExGRd7HpExEpCJs+EZGCsOkTESkImz5RDwiCwDcFkV9i0yfykMVi\nwbBhw5CZmYn4+PgOP+qTSM64sknkIYvFgjvuuANHjhzB2LFjpS6HqEd40ifqhttuu40Nn/wamz5R\nN4SGhkpdAlGvsOkTESkImz5RNyg944X8H1/IJSJSEJ70iYgUhE2fiEhB2PSJiBSETZ+ISEHY9ImI\nFOT/AdQ5DLwCjsLdAAAAAElFTkSuQmCC\n",
"text": [
"<matplotlib.figure.Figure at 0x2575250>"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"average velocity = 0.992000 cm/s\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.12 page number 37\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math \n",
"\n",
"n = 6.;\n",
"h = (3. - 0)/n;\n",
"\n",
"I = (h/2.)*(0+2*0.97+2*1.78+2*2.25+2*2.22+2*1.52+0);\n",
"u_avg = (2./3**2)*I;\n",
"\n",
"print \"average velocity = %f cm/s\"%(u_avg)\n",
"\n",
"print ('Simpsons rule')\n",
"\n",
"n = 6.;\n",
"h = 3./n;\n",
"I = (h/3)*(0+4*(0.97+2.25+1.52)+2*(1.78+2.22)+0);\n",
"u_avg = (2./3**2)*I;\n",
"\n",
"print \"average velocity = %f cm/s\"%(u_avg)\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"average velocity = 0.971111 cm/s\n",
"Simpsons rule\n",
"average velocity = 0.998519 cm/s\n"
]
}
],
"prompt_number": 23
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.13 page number 38\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"z0 = 30.84;\n",
"z1 = 29.89;\n",
"z2 = 29.10;\n",
"h = 4;\n",
"\n",
"u1_t0 = (-3*z0+4*z1-z2)/(2*h);\n",
"u1_t4 = (-z0+z2)/(2*h);\n",
"u1_t8 = (z0-4*z1+3*z2)/(2*h);\n",
"\n",
"z0 = 29.89;\n",
"z1 = 29.10;\n",
"z2 = 28.30;\n",
"u2_t4 = (-3*z0+4*z1-z2)/(2*h);\n",
"u2_t8 = (-z0+z2)/(2*h);\n",
"u2_t12 = (z0-4*z1+3*z2)/(2*h);\n",
"\n",
"z0 = 29.10;\n",
"z1 = 28.30;\n",
"z2 = 27.50;\n",
"u3_t8 = (-3*z0+4*z1-z2)/(2*h);\n",
"u3_t12 = (-z0+z2)/(2*h);\n",
"u3_t16 = (z0-4*z1+3*z2)/(2*h);\n",
"\n",
"u_t4 = (u1_t4+u2_t4)/2;\n",
"u_t8 = (u1_t8+u2_t8+u3_t8)/3;\n",
"u_t12 = (u2_t12+u3_t12)/2;\n",
"\n",
"print \"u_t0 = %f cm/min u_t4 = %f cm/min u_t8 = %f cm/min u_t12 = %f/n cm/min u_t16 =%f/n cm/min \"%(u1_t0,u_t4,u_t8,u_t12,u3_t16)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"u_t0 = -0.257500 cm/min u_t4 = -0.206875 cm/min u_t8 = -0.192083 cm/min u_t12 = -0.200625/n cm/min u_t16 =-0.200000/n cm/min \n"
]
}
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.16 page number 49\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"density_water=988. #in kg/m3\n",
"viscosity_water=55.*10**-5 #in Ns/m2\n",
"density_air=1.21 #in kg/m3\n",
"viscosity_air=1.83*10**-5 #in Ns/m2\n",
"L=1 #length in m\n",
"\n",
"\n",
"L1=10.*L #length in m\n",
"Q=0.0133;\n",
"\n",
"Q1=((Q*density_water*viscosity_air*L)/(L1*viscosity_water*density_air))\n",
"\n",
"print \"flow rate = %f cubic meter/s\"%(Q1)\n",
"\n",
"\n",
"p=9.8067*10**4; #pressure in pascal\n",
"p1=(p*density_water*Q**2*L**4)/(density_air*Q1**2*L1**4);\n",
"\n",
"print \"pressure drop corresponding to 1kp/square cm = %f kP/square cm\"%(p1/p)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"flow rate = 0.036134 cubic meter/s\n",
"pressure drop corresponding to 1kp/square cm = 0.011062 kP/square cm\n"
]
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.17 page number 50\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"L=1. #length of prototype in m\n",
"L1=10*L #length of model in m\n",
"density_prototype=2.65 #gm/cc\n",
"density_water=1. #gm/cc\n",
"\n",
"density_model=(L**3*(density_prototype-density_water))/(L1**3)+1;\n",
"\n",
"print \"specific gravity of plastic = %f\"%(density_model)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"specific gravity of plastic = 1.001650\n"
]
}
],
"prompt_number": 26
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.18 page number 53\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"from numpy import linspace\n",
"from matplotlib.pyplot import *\n",
"\n",
"\n",
"ly = 8 #in cm\n",
"my = ly/((1/0.25) - (1/0.5));\n",
"lz = 10.15 #in cm\n",
"\n",
"mz = lz/((1./2.85) - (1/6.76));\n",
"mx = (my*mz)/(my+mz);\n",
"print \"mx = %f cm\"%(mx)\n",
"err = ((1-0.9945)/0.9945)*100;\n",
"print \"error = %f \"%(err)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"mx = 3.703774 cm\n",
"error = 0.553042 \n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"example 1.19 page number 54\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"w=450. #in kg/hr\n",
"density=1000. #in kg/m3\n",
"d=16. #in mm\n",
"\n",
"u=(w/density)/(3.14*d**2/4);\n",
"Re=u*density*d/0.001;\n",
"\n",
"if Re>2100:\n",
" print \"flow is turbulent and d= %f mm\"%(d)\n",
"else:\n",
" print (\"flow is laminar and this nomograph is not valid\")\n",
"\n",
" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"flow is turbulent and d= 16.000000 mm\n"
]
}
],
"prompt_number": 28
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|