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
|
{
"metadata": {
"name": "",
"signature": "sha256:71218a03a9605d3f7a7341594baa7c6aaf03b045951699482ae5c6da5c0be5f7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h1>Chapter 2: Pressure<h1>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.1, Page Number: 116<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"\n",
"x=10000.0*10.0 #equivalnt to 10kg/cm^2\n",
"\n",
"#result\n",
"print('(a)\\n 10kg/cm^2 = %.0f mmWG' %x)\n",
"\n",
"#(b)\n",
"\n",
"#variable declaration\n",
"onemm_Hg=13.546 #pressure of 1 mm Hg\n",
"\n",
"#calculation\n",
"y=10.0**5/onemm_Hg\n",
"y=y/10.0**3\n",
"\n",
"#result\n",
"print('\\n(b)\\n10kg/cm^2 = 10^5 mmWG = %.2f * 10^3 mmHg' %y)\n",
"\n",
"#(c)\n",
"\n",
"#variable declaration\n",
"onebar=1.03 # 1 Bar presssure in kg/cm^2\n",
"#calculation\n",
"z=10.0/onebar\n",
"\n",
"#result\n",
"print('\\n(c)\\n10kg/cm^2 = %.2f bars' %z)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
" 10kg/cm^2 = 100000 mmWG\n",
"\n",
"(b)\n",
"10kg/cm^2 = 10^5 mmWG = 7.38 * 10^3 mmHg\n",
"\n",
"(c)\n",
"10kg/cm^2 = 9.71 bars"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.2, Page Number: 116<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#(a)\n",
"\n",
"#variable Declaration\n",
"gamm=1000.0 # density of water\n",
"d=35.0 # depth of water \n",
"dens_Hg=13.546 # density of Hg\n",
"\n",
"#calculation\n",
"press_in_kg_cm=gamm*d*10**-4\n",
"press_in_mmHg=gamm*d/dens_Hg\n",
"press_in_mmHg=press_in_mmHg/10**3\n",
"\n",
"#result\n",
"print('(a)\\nThe pressure at depth of %d meters in a water tank=%.1f kg/cm^2 = %.2f*10^3 mmHg'%(d, press_in_kg_cm, press_in_mmHg))\n",
"\n",
"#(b)\n",
"\n",
"#varible declaration\n",
"press_atm=1.03 #atmospheric pressure\n",
"\n",
"#calculation\n",
"abspress=press_in_kg_cm+press_atm\n",
"abspress_mmHg=press_in_mmHg*1000.0+760.0\n",
"abspress_mmHg=abspress_mmHg/1000.0\n",
"\n",
"#result\n",
"print('\\n(b)\\nAbsolute Pressure= %.2f kg/cm^2 Abs = %.2f*10^3 mmHg Abs'%(abspress, abspress_mmHg))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"The pressure at depth of 35 meters in a water tank=3.5 kg/cm^2 = 2.58*10^3 mmHg\n",
"\n",
"(b)\n",
"Absolute Pressure= 4.53 kg/cm^2 Abs = 3.34*10^3 mmHg Abs"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.3, Page Number:116<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#varible declaration\n",
"egp=260.0 # equivalent gauge pressure\n",
"\n",
"#calculation\n",
"abspress=760.0-egp\n",
"\n",
"#result\n",
"print('Absolute Presssure = %d mmHg' %abspress)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Absolute Presssure = 500 mmHg"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.4,Page Number:117<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#(a)\n",
"\n",
"#variable declaration\n",
"p_diff=500.0 #pressure difference in mmHg\n",
"\n",
"#calculations\n",
"pdiff=p_diff*13.546/10000\n",
"\n",
"#Result\n",
"print('(a)\\np1-p2 = %.3f kg/cm^2' %pdiff)\n",
"\n",
"\n",
"#(b)\n",
"\n",
"#variable declaration\n",
"p1=6770.0 # Gauge pressure in mmWG\n",
"p_atm=10300.0 # atmospheric pressure \n",
"\n",
"#calculation\n",
"abs_p1=p1+p_atm\n",
"\n",
"#result\n",
"print('\\n(b)If p2 is open to atmosphere:\\nAbsolute Pressure P1 = %d mmWG abs.' %abs_p1)\n",
"\n",
"#(c)\n",
"\n",
"#variable declaration\n",
"P1=500.0 #mmHg absolute pressure\n",
"\n",
"#calculations\n",
"P1_gauge=P1-760.0\n",
"\n",
"#result\n",
"print('\\n(c)If p2 is evacuated and sealed:\\np1= %d mmHg gauge Pressure' %P1_gauge)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"p1-p2 = 0.677 kg/cm^2\n",
"\n",
"(b)If p2 is open to atmosphere:\n",
"Absolute Pressure P1 = 17070 mmWG abs.\n",
"\n",
"(c)If p2 is evacuated and sealed:\n",
"p1= -260 mmHg gauge Pressure"
]
}
],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.5, Page Number: 117<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#variable declaration\n",
"spe_grav_water=1.0 # specific gravity of water\n",
"\n",
"#calculation\n",
"spe_grav_X=spe_grav_water*100.0/50.0\n",
"wt_dens_water=1000.0\n",
"wt_dens_X=wt_dens_water*2.0\n",
"\n",
"#result\n",
"print('Weight Density of X = %d kg/m^3' %wt_dens_X)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Weight Density of X = 2000 kg/m^3"
]
}
],
"prompt_number": 5
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.6, Page Number: 117<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#variable declaration\n",
"A=1.0/20.0 # Area ratio\n",
"p_diff=1500.0 # pressure difference in mmWG\n",
"\n",
"#result\n",
"print('(a)\\nAs Delta_h=A2/A1*h << h and normally negligible for well type manometer')\n",
"print('hence, p1-p2 = h = %d =111 mmHg' %p_diff)\n",
"print('\\n(b)\\nh measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg')\n",
"print('(Since area of both legs are same)')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"As Delta_h=A2/A1*h << h and normally negligible for well type manometer\n",
"hence, p1-p2 = h = 1500 =111 mmHg\n",
"\n",
"(b)\n",
"h measured above the oriinal reference will be half of H, i.e. 111/2=55.5 mmHg\n",
"(Since area of both legs are same)"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.7, Page Number: 119<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"print('1 kg/cm^2 = 10 mWG\\n')\n",
"\n",
"#(a)\n",
"\n",
"#variable declaration\n",
"press=10+2 #pressure read by the gauge\n",
"\n",
"#result\n",
"print('\\n(a)Bourdon Gauge is mounted 20 meters below water line:')\n",
"print('\\nPressure read by the Gauge = %d kg/cm^2'%press)\n",
"\n",
"\n",
"#(b)\n",
"\n",
"#variable declaration\n",
"press2=10-3 #pressure read by the gauge\n",
"\n",
"#result\n",
"print('\\n\\n(b)Bourdon Gauge is located 30 meters above the water line:')\n",
"print('\\nPressure read by the Gauge = %d kg/cm^2'%press2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"1 kg/cm^2 = 10 mWG\n",
"\n",
"\n",
"(a)Bourdon Gauge is mounted 20 meters below water line:\n",
"\n",
"Pressure read by the Gauge = 12 kg/cm^2\n",
"\n",
"\n",
"(b)Bourdon Gauge is located 30 meters above the water line:\n",
"\n",
"Pressure read by the Gauge = 7 kg/cm^2"
]
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.8, Page Number: 120<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#Variable declaration\n",
"dens_water=1000.0 # water Density\n",
"h1=125.0 # height1 mm\n",
"h2=250.0 # height2 mm\n",
"d2=h1*dens_water/h2\n",
"\n",
"#result\n",
"\n",
"#a\n",
"print('(a)\\nDensity of Liquid = %d kg/m^3' %d2)\n",
"print('\\nSpecific Density of the liquid = %.1f' %(h1/h2))\n",
"\n",
"#(b)\n",
"print('\\n\\n(b)\\nIf Values of water and liquid interchanged:\\n')\n",
"d3=h2*dens_water/h1\n",
"print('\\nDensity of Liquid = %d kg/m^3' %d3)\n",
"print('\\nSpecific Density of the liquid = %.1f' %(h2/h1))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"Density of Liquid = 500 kg/m^3\n",
"\n",
"Specific Density of the liquid = 0.5\n",
"\n",
"\n",
"(b)\n",
"If Values of water and liquid interchanged:\n",
"\n",
"\n",
"Density of Liquid = 2000 kg/m^3\n",
"\n",
"Specific Density of the liquid = 2.0"
]
}
],
"prompt_number": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.9, Page Number: 120<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"import math\n",
"#variable Declaration\n",
"R=120.0 #resistance\n",
"l=122.0 #length\n",
"a=0.1 #area\n",
"R1=140.0 #resistance in ohm\n",
"\n",
"#calculation\n",
"rho=R*a/l\n",
"l1=math.sqrt(R1*a*l/rho)\n",
"l1=round(l1,0)\n",
"\n",
"#Result\n",
"print('Length l1 = %d meters' %l1)\n",
"A1=a*l/l1\n",
"print('\\nArea A1 = %.4f mm^2' %A1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Length l1 = 132 meters\n",
"\n",
"Area A1 = 0.0924 mm^2"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.10, Page Number: 121<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"c=0.57 #Constant\n",
"\n",
"#(a)\n",
"\n",
"#variable declaration\n",
"d=0.1 #distance between plates\n",
"di1=100.0 #Dielectric constant\n",
"di2=1000.0 #Dielectric constant\n",
"\n",
"#calculation\n",
"c1=c*di1*10.0/d\n",
"c1=round(c1,0)\n",
"\n",
"#result\n",
"print('(a)\\nC1=%d pf' %c1)\n",
"\n",
"\n",
"#(b)\n",
"\n",
"#calculation\n",
"c2=c*di2*10/d\n",
"\n",
"#result\n",
"print('\\n(b)\\nC2=%d pf' %c2)\n",
"\n",
"\n",
"#(c)\n",
"\n",
"#calculation\n",
"ds=0.09\n",
"c11=c*di1*10/ds\n",
"c12=c*di2*10/ds\n",
"\n",
"#result\n",
"print('\\n(c)\\nC1 = %.1f pf\\nC2 = %d pf'%(c11,c12))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)\n",
"C1=5700 pf\n",
"\n",
"(b)\n",
"C2=57000 pf\n",
"\n",
"(c)\n",
"C1 = 6333.3 pf\n",
"C2 = 63333 pf"
]
}
],
"prompt_number": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.11, Page Number: 121<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"#variable Declaration\n",
"A=1.0 #area\n",
"p1=10.0 #pressure\n",
"\n",
"#calculation\n",
"W1=A*p1\n",
"\n",
"#Result\n",
"print('W1 = %d kg' %W1)\n",
"print('\\nWith the 4 standard weights of 10kg, 20kg, 30kg and 40kg')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"W1 = 10 kg\n",
"\n",
"With the 4 standard weights of 10kg, 20kg, 30kg and 40kg"
]
}
],
"prompt_number": 11
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h3>Example 2.12, Page Number: 122<h3>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"#varable declaration\n",
"p1=10**-2 #pressure in torr\n",
"h1=20.0 #height in mm\n",
"\n",
"#xalculation\n",
"K=p1/h1**2\n",
"p2=K*30**2\n",
"p2=p2*100.0\n",
"\n",
"#Result\n",
"print('The unknown pressure p2 = %.2f * 10^-2 torr' %p2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The unknown pressure p2 = 2.25 * 10^-2 torr"
]
}
],
"prompt_number": 12
}
],
"metadata": {}
}
]
}
|