summaryrefslogtreecommitdiff
path: root/Heat_And_Thermodynamics_by_A._Manna/ch9.ipynb
blob: 00373b6ec1ed8ce1b39fb419f74fc87af2f19d72 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9 : Second law of thermodynamics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.1 pageno : 308"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t2 = 300;\t\t\t#temperature of the math.sink in K\n",
      "n1 = 0.4;\t\t\t#efficiency of the engine\n",
      "n2 = 0.6;\t\t\t#efficiency of the engine\n",
      "\n",
      "# Calculations\n",
      "t1 = t2/(1-n1);\t\t\t#temperature of the source in K\n",
      "t3 = t2/(1-n2);\t\t\t#temperature of the source in K\n",
      "\n",
      "# Result\n",
      "print 'the temperature of the source when 0.4 efficiency is %3.2f K  \\\n",
      "\\nthe temperature of the source when 0.6 efficiency is %3.2f K'%(t1,t3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the temperature of the source when 0.4 efficiency is 500.00 K  \n",
        "the temperature of the source when 0.6 efficiency is 750.00 K\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.2 pageno : 308"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t2 = 273.;\t\t\t#temperature of the math.sink in K\n",
      "t1 = 373.;\t\t\t#temperature of the source in K\n",
      "q1 = 840.;\t\t\t#heat supplied in joules\n",
      "j = 4.2;\t\t\t#joukes constant in erg/cal\n",
      "\n",
      "# Calculations\n",
      "w = (q1/t1)*(t1-t2);\t\t\t#work done in joules\n",
      "q2 = (q1/j)*(t2/t1);\t\t\t#heat rejected in calories\n",
      "n = 1-(t2/t1);\t\t\t#efficiency of the engine\n",
      "\n",
      "# Result\n",
      "print 'work done is %3.f j  \\\n",
      "\\nheat rejected is %3.f cal  \\\n",
      "\\nthe efficiency of the engine is %3.1f %%'%(w,q2,n*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "work done is 225 j  \n",
        "heat rejected is 146 cal  \n",
        "the efficiency of the engine is 26.8 %\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.3 pageno : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t1 = 90.;\t\t\t#temperature of the oxygen boils in K\n",
      "t2 = 20.;\t\t\t#temperature of the liquid hydrogen in K\n",
      "t3 = 300.;\t\t\t#temperature of the sink in K\n",
      "\n",
      "# Calculations\n",
      "n = (t1-t2)/t1;\t\t\t#efficiency of the engine\n",
      "t4 = t3/(1-n);\t\t\t#temperature of the source in K\n",
      "\n",
      "# Result\n",
      "print 'the efficiency of the engine is %3.2f  \\\n",
      "\\nthe temperature of the source is %3.2f K'%(n,t4)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the efficiency of the engine is 0.78  \n",
        "the temperature of the source is 1350.00 K\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.4 pageno : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t1 = 373.;\t    \t    \t#temperature of the source in K\n",
      "t2 = 273.;\t\t    \t    #temperature of the sink in K\n",
      "w = 1200*10**5*980;\t\t\t#work done in ergs\n",
      "j = 4.18*10**7;\t\t    \t#joules constant in ergs/cal\n",
      "\n",
      "# Calculations\n",
      "q = (w/j)*(t1/(t1-t2));\t\t\t#heat added in cal\n",
      "\n",
      "# Result\n",
      "print 'the heat added is %3.2f cal'%(round(q,-1))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the heat added is 10490.00 cal\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.5 pageno : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t1 = 273.;\t\t\t#temperature of the source in K\n",
      "t2 = 290.;\t\t\t#temperature of the sink in K\n",
      "l = 8*10.**11;\t\t\t#latent of fusion in ergs/cal\n",
      "\n",
      "# Calculations\n",
      "n = (t2-t1)/t1;\t\t\t#efficiency of the engine\n",
      "w = n*l;\t\t\t#energy to be supplied in ergs\n",
      "\n",
      "# Result\n",
      "print 'efficiency of the engine is %.2f %%  \\\n",
      "\\nenergy to be supplied is %.3e ergs'%(n*100,w)\n",
      "print \"Note: answer in book are wrong please calculate manually.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "efficiency of the engine is 6.23 %  \n",
        "energy to be supplied is 4.982e+10 ergs\n",
        "Note: answer in book are wrong please calculate manually.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.6 pageno : 309"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "# Variables\n",
      "t1 = 373;\t\t\t#temperature in K\n",
      "t2 = 273;\t\t\t#temperature of math.sink in K\n",
      "q = 10**4;\t\t\t#heat taken at higher temperature in cal\n",
      "j = 4.2*10**7;\t\t\t#joules consmath.tant in ergs/cal\n",
      "\n",
      "# Calculations\n",
      "w = q*j*(t1-t2)/t1;\t\t\t#work done in ergs\n",
      "\n",
      "# Result\n",
      "print 'work done is %.1e ergs'%(w)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "work done is 1.1e+11 ergs\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.7 page no : 310"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "# Variables\n",
      "p = 100*746/4.2;\t\t\t#power developed in cal/sec\n",
      "t1 = 300.;\t\t\t#temperature of the sink in K\n",
      "t2 = 500.\n",
      "\n",
      "# Calculations\n",
      "te = 1 - (t1/t2)\n",
      "Q1 = p * 100/40        # heat supplied\n",
      "Q2 = Q1 * 0.6\n",
      "\n",
      "\n",
      "# Result\n",
      "print \"Thermal efficiency = %.f %%\"%(te*100)\n",
      "print \"Power developed by the engine %.2f calories/sec\"%p\n",
      "print \"If Q1 heat supplied , Q1 = %.2e cal/sec\"%Q1\n",
      "print \"Q2 = %.2e cal/sec\"%Q2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thermal efficiency = 40 %\n",
        "Power developed by the engine 17761.90 calories/sec\n",
        "If Q1 heat supplied , Q1 = 4.44e+04 cal/sec\n",
        "Q2 = 2.66e+04 cal/sec\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.8 page no : 310"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "l = 964.8;\t\t\t#latent heat of steam in B.Th.U per lb\n",
      "q = 4*15*l*778;\t\t\t#heat developed in ft lbs\n",
      "w = 30000*60;\t\t\t#work done is ft lbs\n",
      "pv = 12*1.013*10**6*10**3 \n",
      "T = 600                # K\n",
      "\n",
      "# Calculations\n",
      "n = (w/q)*100;\t\t\t#efficiency of the engine\n",
      "p = 100-n;\t\t\t#percentage of heat wasted\n",
      "T2 = 600./(6**.4)\n",
      "R = pv/T\n",
      "W = R * (T - T2) * 2.303 * math.log10(6)\n",
      "e = 1 - (T2/T)\n",
      "# Result\n",
      "print \"Lowest temperature T2 = %.f K\"%T2\n",
      "print \"Work done W = %.2e ergs\"%W\n",
      "print \"Efficiency = %.1f %%\"%(e*100)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Lowest temperature T2 = 293 K\n",
        "Work done W = 1.11e+10 ergs\n",
        "Efficiency = 51.2 %\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.9 page no : 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "l=964.8;            #latent heat of steam in B.Th.U per lb\n",
      "q=4*15*l*778;       #heat developed in ft lbs\n",
      "w=33000*60;         #work done is ft lbs\n",
      "\n",
      "#CALCULATIONS\n",
      "n=(w/q)*100;       #efficiency of the engine\n",
      "p=100-n;          #percentage of heat wasted\n",
      "\n",
      "# Results\n",
      "print ('the percentage of the heat wasted is %3.2f'%p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the percentage of the heat wasted is 95.60\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.10 page no : 311"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "ip = 16.3*500*778/33000;\t\t\t# Variables power of the engine in HP\n",
      "me = 0.72;\t\t\t#mechanical efficiency of the engine\n",
      "bhp = 31;\t\t\t#brake horse power in b.h.p\n",
      "ihp = bhp/me;\t\t\t#indicated horse power in HP\n",
      "\n",
      "# Calculations\n",
      "i = ihp/ip;\t\t\t#indicated thermal efficiency\n",
      "\n",
      "# Result\n",
      "print 'the indicted thermal efficiency is %3.2f %%'%(i*100)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the indicted thermal efficiency is 22.41 %\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.11 pageno : 312"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p = 200.;\t\t\t#horse power of steam engine in lbs coal per hour\n",
      "j = 770.;\t\t\t#joules constant in ft lbs per B.Th.U\n",
      "\n",
      "# Calculations\n",
      "w = 12500*p*j;\t\t\t#equivalent work in ft.lb.per.hr\n",
      "hp = w/(60*33000);\t\t\t#horse power\n",
      "\n",
      "# Result\n",
      "print 'horse power of the engine is %3.2f'%(hp)\n",
      "print \"Note : answer in book is wrong. Please check manually.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "horse power of the engine is 972.22\n",
        "Note : answer in book is wrong. Please check manually.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.12 pageno  : 312"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t1 = 340.;\t\t\t#temperature of the atmosphere in K\n",
      "t2 = 612.;\t\t\t#temperature of the compression stroke in K\n",
      "y = 1.39;\t\t\t#adiabatic expansion \n",
      "t3 = 2040.;\t\t\t#temperature after consmtant volume ignition in K\n",
      "\n",
      "# Calculations\n",
      "d = (t2/t1)**(1/(y-1))\t\t\t#density in gm/cc\n",
      "n = 1-(1/d)**(y-1);\t\t    \t#efficiency of the engine\n",
      "p = ((d)**(y))*(t3/t2);\t\t\t#maximum temperature of the temperature in atm\n",
      "\n",
      "# Result\n",
      "print 'the maximum pressure of the engine is %3.f atm'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the maximum pressure of the engine is  27 atm\n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.13 pageno : 313"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t1 = 915;\t\t\t#temperature at the beggining in K\n",
      "t2 = 2040;\t\t\t#temperature at the end in K\n",
      "d = 12.6;\t\t\t#adiabatic expansion ratio\n",
      "y = 1.39;\t\t\t#coefficent of expansion\n",
      "\n",
      "# Calculations\n",
      "x = t2/t1                               \t\t\t#ratio temparatures\n",
      "n = 1-(1/d)**(y-1)*((x**y)-1)/(y*(x-1));\t\t\t#efficiency of the engine\n",
      "\n",
      "# Result\n",
      "print 'the efficiency of the engine is %3.3f'%(n)\n",
      "print \"Note : answer slighty different because of rounding error\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the efficiency of the engine is 0.566\n",
        "Note : answer slighty different because of rounding error\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.14 pageno : 313"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p1 = 15.;\t\t\t#intial pressure in lb/sq.inch\n",
      "dv = 15.;\t\t\t#ratio of intial to final volume\n",
      "t1 = 520.;\t\t\t#temperature at intial in K\n",
      "y = 1.4;\t\t\t#coefficient of expansion\n",
      "\n",
      "# Calculations\n",
      "p2 = p1*(dv)**(y);\t\t\t#final pressure in lb/sq.inch\n",
      "t2 = t1*(dv)**(y-1);\t\t\t#final temperatire in K\n",
      "\n",
      "# Result\n",
      "print 'the final pressure is %3.2f lb/sq.inch  \\\n",
      "\\nthe final temperature is %.f K'%(p2,t2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the final pressure is 664.69 lb/sq.inch  \n",
        "the final temperature is 1536 K\n"
       ]
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}