summaryrefslogtreecommitdiff
path: root/Heat_And_Thermodynamics_by_A._Manna/ch8.ipynb
blob: c82c1776726672672558bb255b512f4a27972871 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8 : First law of thermodynamics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1 page no : 261\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "l = 80;\t\t\t#latent heat of fusion in cal\n",
      "j = 4.2*10**7;\t\t\t#joules constant in ergs/cal\n",
      "w = -0.092*10**6;\t\t\t#work done in changing phase change in ergs\n",
      "\n",
      "# Calculations\n",
      "q = l*j;\t\t\t#heat added in ergs\n",
      "du = q-w;\t\t\t#internal energy in ergs\n",
      "\n",
      "# Result\n",
      "print 'the change in internal energy is %.1e ergs'%(du)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the change in internal energy is 3.4e+09 ergs\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2 page no : 261"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "m = 1.;\t        \t\t#mass in gm\n",
      "l = 536.;\t\t    \t#latent heat in cal/gm\n",
      "j = 4.2*10**7;\t\t\t#joules constant in ergs/cal\n",
      "v = 1649;\t\t\t    #volume of water in cc\n",
      "p = 76*13.6*981;\t\t#pressure of water in dynes/sq.cm\n",
      "\n",
      "# Calculations\n",
      "dq = m*l*j;\t\t\t#heat supplied in ergs\n",
      "dw = p*v;\t\t\t#work done in ergs\n",
      "du = dq-dw;\t\t\t#internal energy developed in ergs\n",
      "\n",
      "# Result\n",
      "print 'internal energy of water is %.2E ergs'%(du)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "internal energy of water is 2.08E+10 ergs\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3 pageno : 261"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "dv = 10;\t\t\t#ratio of original volume to final volume\n",
      "t1 = 293;\t\t\t#inital temperature in K\n",
      "y = 1.41;\t\t\t#coefficent of expansion\n",
      "\n",
      "# Calculations\n",
      "t2 = t1*(dv)**(y-1);\t\t\t#final temperature in K\n",
      "\n",
      "# Result\n",
      "print 'the final temperature is %.f K'%(t2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the final temperature is 753 K\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4 pageno : 261"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t = 273;\t\t\t#temperature of earth at height h in K\n",
      "p = 760;\t\t\t#pressure in mm of hg\n",
      "dp = 1;\t\t\t#change in pressure in mm of hg\n",
      "y = 1.418;\t\t\t#coefficient of expansion\n",
      "\n",
      "# Calculations\n",
      "dt = ((y-1)/y)*dp*t/p;\t\t\t#change in temperature in deg.C\n",
      "\n",
      "# Result\n",
      "print 'the change in temperature is %3.3f deg.C'%(dt)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the change in temperature is 0.106 deg.C\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5 pageno : 262"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p1 = 2;\t\t\t#pressure initial in atm\n",
      "p2 = 1.;\t\t\t#pressure final in atm\n",
      "t1 = 273 + 15;\t\t\t#inital temperature in K\n",
      "y = 1.4;\t\t\t#coefficent of expansion\n",
      "\n",
      "# Calculations\n",
      "t2 = t1*(p2/p1)**((y-1)/y);\t\t\t#final temperature in K\n",
      "dt = t1-t2;\t\t\t#drop in temperature in K\n",
      "\n",
      "# Result\n",
      "print 'drop in temperature is %3.2f K'%(dt)\n",
      "print \"Note : answer is slightly different because of rounding error\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "drop in temperature is 51.74 K\n",
        "Note : answer is slightly different because of rounding error\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6 pageno : 262"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t1 = 288;\t\t\t#inital temperature in K\n",
      "dv = 1./2;\t\t\t#ratio of inital to final volume\n",
      "y = 1.4;\t\t\t#coefficient of expansion\n",
      "\n",
      "# Calculations\n",
      "t2 = t1*(dv)**(y-1);\t\t\t#final temperature in K\n",
      "\n",
      "# Result\n",
      "print 'the final temperature is %3.1f K'%(t2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the final temperature is 218.3 K\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7 pageno : 262"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "y = 1.4;\t\t\t#coefficent of exapnsion\n",
      "p1 = 1;\t\t\t#standard pressure in atm\n",
      "dv = 50;\t\t\t#ratio of initial volume to final volume\n",
      "t1 = 273;\t\t\t#standard temperature in K\n",
      "\n",
      "# Calculations\n",
      "p2 = p1*dv;\t\t\t#final pressure when slowly compressed in atm\n",
      "p3 = p1*(dv)**(y);\t\t\t#final pressure when suddenly compressed in atm\n",
      "t2 = t1*(dv)**(y-1);\t\t\t#rise in temperature when it is suddenly compressed in K\n",
      "\n",
      "# Result\n",
      "print 'the final pressure when it is compressed slowly is %.f atm  \\\n",
      "\\nthe final pressure when it is compressed suddenly is %.f atm  \\\n",
      "\\nthe rise in temperature when it is suddenly compressed is %.0f K'%(p2,p3,t2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the final pressure when it is compressed slowly is 50 atm  \n",
        "the final pressure when it is compressed suddenly is 239 atm  \n",
        "the rise in temperature when it is suddenly compressed is 1305 K\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8 pageno : 263"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "y = 1.5;\t\t\t#coefficient of expansion\n",
      "dp = 1./8;\t\t\t#ratio of inital pressure to final pressure\n",
      "t1 = 300;\t\t\t#inital tempreature in K\n",
      "\n",
      "# Calculations\n",
      "t2 = t1*(dp)**((1-y)/y);\t\t\t#change in temperature in K\n",
      "t3 = t2-t1;\t\t\t#rise in temperature in K\n",
      "\n",
      "# Result\n",
      "print 'the rise in temperature is %3.2f K'%(t3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the rise in temperature is 300.00 K\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.9 pageno : 263"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "# Variables\n",
      "t1 = 400;\t\t\t#inital temperature in K\n",
      "dv = 2;\t\t\t#ratio of volumes final and inital\n",
      "r = 8.31*10**7;\t\t\t#universal gas constant in ergs/kg.K\n",
      "\n",
      "# Calculations\n",
      "w = r*t1*math.log(2);\t\t\t#work done in expanding isothermally in ergs\n",
      "\n",
      "# Result\n",
      "print 'the work done in expanding isothermally is %.1e ergs'%(w)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done in expanding isothermally is 2.3e+10 ergs\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.10 page no : 263"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p1 = 76;\t\t\t#inital pressure in cm\n",
      "t1 = 290;\t\t\t#inital temperature in K\n",
      "y = 1.4;\t\t\t#coefficent of expansion\n",
      "dv = 2;\t\t\t#ratio of inital to fianl volume when air expands isothermally \n",
      "dv1 = 2;\t\t\t#ratio of inital to final volume when air expands adiabatically\n",
      "\n",
      "# Calculations\n",
      "p2 = p1/dv;\t\t\t#final pressure when air expands isothermally in cm of hg\n",
      "t2 = t1;\t\t\t#final temperature when air expands isothermally in K\n",
      "t3 = t2*(1./dv1)**(y-1);\t\t\t#temprature when air expands adiabatically in K\n",
      "p3 = p2*(1./dv1)**(y);\t\t\t#final pressure when air expands adiabatically in mm of hg\n",
      "\n",
      "# Result\n",
      "print 'final pressure when air expands isothermally in cm of hg %3.2f mm of hg  \\\n",
      "\\nfinal temperature when air expands isothermally is %3.2f K  \\\n",
      "\\ntemprature when air expands adiabatically is %3.1f K  \\\n",
      "\\nfinal pressure when air expands adiabatically is %3.2f cm of mercury'%(p2,t2,t3,p3)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "final pressure when air expands isothermally in cm of hg 38.00 mm of hg  \n",
        "final temperature when air expands isothermally is 290.00 K  \n",
        "temprature when air expands adiabatically is 219.8 K  \n",
        "final pressure when air expands adiabatically is 14.40 cm of mercury\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.11 pageno : 264"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p = 76*13.6*981;\t\t\t#pressure of air in dynes/sq.cm\n",
      "v = 11100.;\t\t\t#volume expanded in ml\n",
      "t1 = 273.;\t\t\t#inital temperature in K\n",
      "t2 = 274.;\t\t\t#final temperature in K\n",
      "cv = 2.411;\t\t\t#specific heat at constant volume in cal/K\n",
      "j = 4.2*10**7;\t\t\t#joules constant in ergs/cal\n",
      "\n",
      "# Calculations\n",
      "w = p*v*math.log(t2/t1);\t\t\t#work done in ergs\n",
      "h = cv*(t2-t1)+w/j;\t\t\t        #heat supplied in cal\n",
      "\n",
      "# Result\n",
      "print 'the work done is %3.3e erg  \\\n",
      "\\nthe heat supplied is %3.3f cal'%(w,h)\n",
      "print \"Note : answer is different because of rounding error\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done is 4.115e+07 erg  \n",
        "the heat supplied is 3.391 cal\n",
        "Note : answer is different because of rounding error\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.12 pageno : 264"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p = 10**6;\t\t\t#pressure of air in dynes\n",
      "d = 0.0001293;\t\t\t#density of air in gm/cc\n",
      "t1 = 273;\t\t\t#inital temperature in K\n",
      "dv = 2;\t\t\t#ratio of inital volume to final volume\n",
      "y = 1.4;\t\t\t#coefficient of expansion\n",
      "\n",
      "# Calculations\n",
      "r = p/(d*t1);\t\t\t#universal gas constant in dynes.cc/gm.K\n",
      "t2 = round(t1*(dv)**(y-1));\t\t\t#final temperature in K\n",
      "w = r*(t2-t1)/(y-1);\t\t\t#work done in adiabatic compression in ergs\n",
      "\n",
      "# Result\n",
      "print 'work done in adiabatic compression is %.3e ergs'%(w)\n",
      "print \"Note : answer is different because of rounding error\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "work done in adiabatic compression is 6.162e+09 ergs\n",
        "Note : answer is different because of rounding error\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.13 pageno : 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "m = 5;\t\t\t#mass of air in gm\n",
      "cv = 0.172;\t\t\t#specific heat at consmath.tant volume cal/gm\n",
      "dt = 10;\t\t\t#changi in temperature in K\n",
      "\n",
      "# Calculations\n",
      "ie = m*cv*dt;\t\t\t#change in internal energy in cal\n",
      "\n",
      "# Result\n",
      "print 'change in internal energy is %3.2f cal'%(ie)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "change in internal energy is 8.60 cal\n"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.14 pageno : 265"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "v1 = 10**3;\t\t\t#inital volume in cc\n",
      "v2 = 2*v1;\t\t\t#final volume in cc\n",
      "p1 = 76*13.6*981;\t\t\t#pressure in dyne/sq.cm\n",
      "t1 = 273;\t\t\t#intial temperature in K\n",
      "d = 1.29;\t\t\t#density of the gas gm/lit\n",
      "cv = 0.168;\t\t\t#specific heat at constant volume in cal/gm\n",
      "\n",
      "# Calculations\n",
      "t2 = (v2/v1)*t1;\t\t\t#final temperature in K\n",
      "r = 0.068;\t\t\t#universal gas consmath.tant in cal\n",
      "cp = cv+r;\t\t\t#specific heat at constant pressure in cal\n",
      "q = d*cp*(t2-t1);\t\t\t#heat supplied in cal\n",
      "\n",
      "# Result\n",
      "print 'the heat supplied to the gas is %3.2f cal'%(q)\n",
      "print \"Note: answer is slightly different because of rounding error.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the heat supplied to the gas is 83.11 cal\n",
        "Note: answer is slightly different because of rounding error.\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.15 pageno : 165"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "t = 303;\t\t\t#temperature of the one mole of the argon in K\n",
      "v1 = 1;\t\t\t#intial volume in litres\n",
      "v2 = 10;\t\t\t#final volume in litres\n",
      "r = 8.31*10**7;\t\t\t#universal gas constant in ergs/K.mol\n",
      "\n",
      "# Calculations\n",
      "w = r*t*math.log(v2/v1);\t\t\t#work done in isothermal expansion in ergs\n",
      "\n",
      "# Result\n",
      "print 'the work done in isothermal expansion is %.1e ergs'%(w)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done in isothermal expansion is 5.8e+10 ergs\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.16 pageno : 266"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "dv = 4;\t\t\t#final volume of neon in lit\n",
      "t = 273;\t\t\t#temperature of the gas in K\n",
      "n = 2.6/22.4;\t\t\t#the no.of moles of neon\n",
      "r = 1.98;\t\t\t#universal gas constant in cal/K.mol\n",
      "\n",
      "# Calculations\n",
      "w = n*t*r*math.log(dv);\t\t\t#work done by gas in ergs\n",
      "\n",
      "# Result\n",
      "print 'the work done by 2.6lit of neon is %3.2f ergs'%(w)\n",
      "print \"Note: answer is slightly different because of rounding error.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the work done by 2.6lit of neon is 86.98 ergs\n",
        "Note: answer is slightly different because of rounding error.\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.18 page no : 266"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variables\n",
      "dv = 10**(-3);\t\t\t#ratio of initial and final volume\n",
      "t1 = 10**5;\t\t\t#initial temperature in K\n",
      "y = 1.66;\t\t\t#coefficient of expansion\n",
      "\n",
      "# Calculations\n",
      "t2 = t1*((4./3*math.pi*10**12)/(4./3*math.pi*10**15))**(y-1);\t\t\t#final temperature in K\n",
      "\n",
      "# Result\n",
      "print 'final temperature of the gas is %3.2f K'%(t2)\n",
      "print \"Note : Answer in book is wrong. Please calculate manually.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "final temperature of the gas is 1047.13 K\n",
        "Note : Answer in book is wrong. Please calculate manually.\n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.19 pageno : 267"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p1 = 8.;\t\t\t#intial pressure in cm of hg\n",
      "p2 = 6.;\t\t\t#final pressure in cm of hg\n",
      "v1 = 1000.;\t\t\t#intial volume in cc\n",
      "v2 = 1190.;\t\t\t#final volume in cc\n",
      "\n",
      "# Calculations\n",
      "y = math.log(p1/p2)/math.log(v2/v1);\t\t\t#coefficient of expansion\n",
      "\n",
      "# Result\n",
      "print 'the coefficent of expansion is %3.2f'%(y)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the coefficent of expansion is 1.65\n"
       ]
      }
     ],
     "prompt_number": 42
    }
   ],
   "metadata": {}
  }
 ]
}