summaryrefslogtreecommitdiff
path: root/Heat_and_Thermodynamics_by_Brijlal_and_N._Subrahmanyam/chA.ipynb
blob: 40c49ef7bd3410605dd9437eafe1f98261eb1c76 (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
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
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
{
 "metadata": {
  "name": "",
  "signature": "sha256:df5fbd8c032abd96a18eaa179ff1b33448892f4e62b9b9800c35cefba3950007"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Appendix Examples"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.1  Page No : 557"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "T = 300.  # The given temperature in K\n",
      "R = 8.31  # Universal gas constant in J/mole-K\n",
      "\n",
      "# Calculations\n",
      "# The total random kinetic energy of one gram mole of oxygen in J\n",
      "U = (3. / 2) * R * T\n",
      "\n",
      "# Output\n",
      "print 'The total random kinetic energy of one gram mole of oxygen is U = %3.0f J ' % (U)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total random kinetic energy of one gram mole of oxygen is U = 3740 J \n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.2  Page No : 560"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "a = 0.245  # Van der Waals constant in atoms-litre**2-mole**-2\n",
      "b = 2.67 * 10**-2  # Van der Waals constant in litre-mole**-1\n",
      "R = 8.314 * 10**7  # Universal gas constant in ergs/mole-K\n",
      "\n",
      "# Calculations\n",
      "# Van der Waals constant in dynes-cm**4-mole**-2\n",
      "a1 = a * 76 * 13.6 * 980 * 10**6\n",
      "b1 = b * 10**3  # Van der Waals constant in cm**3mole**-1\n",
      "Tc = (8. / 27) * (a1 / b1) * (1 / R)  # The critical temperature in K\n",
      "Tc1 = Tc - 273  # The critical temperature in degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The critical temperature is Tc = %3.2f K  (or) %3.2f degree centigrade ' % (Tc, Tc1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The critical temperature is Tc = 33.12 K  (or) -239.88 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.3  Page No : 565"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t = 0.  # The given temperature in degree centigrade\n",
      "E = 5.64 * 10**-21  # The mean kinetic energy of molecules of hydrogen in J\n",
      "R = 8.32  # Universal gas constant in J/mole-K\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The given temperature in K\n",
      "N = (3. / 2) * (R / E) * (T)  # Avogadros number\n",
      "\n",
      "# Output\n",
      "print 'The Avogadro number is N = %3.4g ' % (N)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Avogadro number is N = 6.041e+23 \n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.4  Page No : 570"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 2. * 10**-8  # The diameter of the molecule of a gas in cm\n",
      "k = 1.38 * 10**-23  # Boltzmanns constant in J/K\n",
      "T = 273.  # The temperature at NTP in K\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "d1 = d / 100  # The diameter of the molecule of a gas in m\n",
      "P = 0.76 * 13.6 * 9.8 * 1000  # The pressure at NTP\n",
      "n = P / (k * T)  # The number of molecules per cubic meter\n",
      "l = 1. / (pi * d1**2 * n)  # The mean free path in m\n",
      "\n",
      "# Output\n",
      "print 'The mean free path at NTP is %3.4g m ' % (l)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mean free path at NTP is 2.961e-07 m \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.6  Page No : 577"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "n = 3. * 10**25  # The number of molecules per cubic metre\n",
      "d = 3.6 * 10**-10  # The diameter of oxygen molecule in m\n",
      "M = 32.  # Molecular weight of oxygen\n",
      "N = 6.023 * 10**26  # Avogadro number\n",
      "k = 1.38 * 10**-23  # Boltzmans constant in J/K\n",
      "T = 273.  # The temperature at NTP in K\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "m = M / N  # The mass of oxygen atom in kg\n",
      "# Average speed of oxygen molecule at 273K in m/s\n",
      "V = ((8 * k * T) / (pi * m))**(1. / 2)\n",
      "c = pi * d**2 * V * n  # The collision frequency of the molecules\n",
      "l = 1. / (pi * d**2 * n)  # The mean free path in m\n",
      "\n",
      "# Output\n",
      "print '(a)The collision frequency of the molecules is  %3.2g collisions/second \\n (b)The mean free path is  %3.4g m ' % (c, l)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The collision frequency of the molecules is  5.2e+09 collisions/second \n",
        " (b)The mean free path is  8.191e-08 m \n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.7  Page No : 580"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 9000.  # The density of copper in kg/m**3\n",
      "w = 63.5  # The atomic weight of copper in kg\n",
      "N = 6.023 * 10**26  # Avogadros number\n",
      "pi = 3.14  # Mathematical constant of pi\n",
      "h = 6.624 * 10**-34  # Planks constant in Js\n",
      "\n",
      "# Calculations\n",
      "V = w / d  # The volume of copper in m**3\n",
      "Ef = ((h**2 / (8. * 9. * 10**-31)) * ((3 / pi) * (N / V)) **\n",
      "      (2. / 3)) / (1.6 * 10**-19)  # The fermi energy in eV\n",
      "# The pressure at absolute zero for copper in N/m**2\n",
      "P = (2. / 3) * (N / V) * Ef\n",
      "\n",
      "# Output\n",
      "print '(a)The Fermi energy is E = %3.3f eV \\n (b)The pressure at absolute zero for copper is P = %3.6g N/m^2 ' % (Ef, P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The Fermi energy is E = 7.163 eV \n",
        " (b)The pressure at absolute zero for copper is P = 4.07656e+29 N/m^2 \n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.8  Page No : 586"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "p1 = 80.  # The initial pressure of a gas in cm of Hg\n",
      "p2 = 60.  # The final pressure of a gas in cm of Hg\n",
      "v2 = 1190.  # The final volume occupied by a gas in cc\n",
      "v1 = 1000.  # The initial volume occupied by a gas in cc\n",
      "\n",
      "# Calculations\n",
      "g = (math.log10(p1 / p2)) / (math.log10(v2 / v1))  # The adiabatic index\n",
      "\n",
      "# Output\n",
      "print 'The adiabatic index is  %3.3f ' % (g)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The adiabatic index is  1.654 \n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.9  Page No : 589"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "t = 27.  # The given temperature in degree centigrade\n",
      "R = 8.3  # Universal gas constant in J/deg mole\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The given temperature in K\n",
      "v1 = 1.  # Let the original volume be in cc\n",
      "v2 = 2. * v1  # The final volume in cc\n",
      "W = R * T * math.log(v2 / v1)  # The work done in J\n",
      "\n",
      "# Output\n",
      "print 'The work done is W = %3.1f J ' % (W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The work done is W = 1725.9 J \n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.10  Page No : 594"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 27.  # The initial temperature of the gas in degree centigrade\n",
      "T1 = t1 + 273  # The initial temperature of the gas in K\n",
      "g = 1.5  # The adiabatic index\n",
      "p = 8.  # The ratio of final pressure to the initial pressure\n",
      "\n",
      "# Calculations\n",
      "T2 = ((p)**((g - 1) / g)) * T1  # The final temperature of the gas in K\n",
      "T21 = T2 - 273  # The final temperature of the gas in degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The final temperature of the gas is T2 = %3.0f K  (or)  %3.0f degree centigrade ' % (T2, T21)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The final temperature of the gas is T2 = 600 K  (or)  327 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.11  Page No : 600"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "n = 0.3  # The efficiency of a carnot engine\n",
      "t = 27.  # The temperature of the sinkk in degree centigrade\n",
      "n1 = 0.5  # The increased efficiency of a carnot engine\n",
      "\n",
      "# Calculations\n",
      "T2 = t + 273  # The temperature of the sinkk in K\n",
      "T1 = T2 / (1 - n)  # The temperature of the source for 0.3 efficiency in K\n",
      "T11 = T2 / (1 - n1)  # The temperature of the source for 0.5 efficiency in K\n",
      "T = T11 - T1  # The increase in temperature in K\n",
      "\n",
      "# Output\n",
      "print 'The increase in temperature is T = %3.2f K ' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in temperature is T = 171.43 K \n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.12  Page No : 602"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T1 = 2100.  # One of the operating temperature in K\n",
      "T2 = 700.  # One of the another operating temperature in K\n",
      "n1 = 40.  # The actual efficiency of the engine in percent\n",
      "\n",
      "# Calculations\n",
      "n = (1 - (T2 / T1)) * 100  # The efficiency of the engine in percent\n",
      "# The percentage of actual efficiency to the maximum possible efficiency\n",
      "# in percent\n",
      "n2 = (n1 / n) * 100\n",
      "\n",
      "# Output\n",
      "print 'The percentage of actual efficiency to the maximum possible efficiency is %3.0f percent ' % (n2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage of actual efficiency to the maximum possible efficiency is  60 percent \n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.13  Page No : 609"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T1 = 600.  # The working temperature of the engine in K\n",
      "T2 = 300.  # The another working temperature of the engine in K\n",
      "n = 52.  # Efficiency of the engine claimed by the inventor in percent\n",
      "\n",
      "# Calculations\n",
      "n1 = (1 - (T2 / T1)) * 100  # The carnot efficiency of the engine in percent\n",
      "\n",
      "# Output\n",
      "print 'The efficiency of the engine claimed by inventor is n = %3.0f percent\\nThe carnot efficiency of the engine is n = %3.0f percent \\n (The efficiency claimed is more than the carnots engine efficiency \\n No engine can have efficiency more than carnots efficiency \\n Hence the claim is invalid)' % (n, n1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the engine claimed by inventor is n =  52 percent\n",
        "The carnot efficiency of the engine is n =  50 percent \n",
        " (The efficiency claimed is more than the carnots engine efficiency \n",
        " No engine can have efficiency more than carnots efficiency \n",
        " Hence the claim is invalid)\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.14  Page No : 612"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "H1 = 10.**4  # The heat absorbed by a carnots engine in calories\n",
      "t1 = 627.  # The temperature from a reservoir in degree centigrade\n",
      "t2 = 27.  # The temperature of the sinkk in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the reservoir in K\n",
      "T2 = t2 + 273  # The temperature of the sinkk in K\n",
      "n = (1 - (T2 / T1)) * 100  # The efficiency of the engine in percent\n",
      "H2 = H1 * (T2 / T1)  # The heat rejected to the sinkk in calories\n",
      "W = (H1 - H2) * 4.2  # The work done by the engine in J\n",
      "\n",
      "# Output\n",
      "print 'The efficiency of the engine is n = %3.2f percent  The work done by the engine is W = %3.2g J ' % (n, W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The efficiency of the engine is n = 66.67 percent  The work done by the engine is W = 2.8e+04 J \n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.15  Page No : 619"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "w = 100.  # The given power of an engine in kW\n",
      "t1 = 117.  # The operating temperature of an engine in degree centigrade\n",
      "t2 = 17.  # The another operating temperature of an engine in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The operating temperature of an engine in K\n",
      "T2 = t2 + 273  # The another operating temperature of an engine in K\n",
      "W = w * 1000  # The given power of an engine in J/s\n",
      "n = (1 - (T2 / T1)) * 100  # The efficiency of an engine in percent\n",
      "H = (T1 / T2)  # The amount of heat absorbed to the amount of heat rejected\n",
      "H2 = W / (H - 1)  # The amount of heat rejected per second in J/s\n",
      "H1 = H * H2  # The amount of heat absorbed per second in J/s\n",
      "\n",
      "# Output\n",
      "print '(i)The amount of heat absorbed is %3.0g J/s \\n (ii)The amount of heat rejected is %3.0g J/s \\n (iii)The efficiency of the engine is %3.1f percent ' % (H1, H2, n)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i)The amount of heat absorbed is 4e+05 J/s \n",
        " (ii)The amount of heat rejected is 3e+05 J/s \n",
        " (iii)The efficiency of the engine is 25.6 percent \n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.16  Page No : 626"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m1 = 10.  # The mass of water at 60 degree centigrade in g\n",
      "m2 = 30.  # The mass of water at 20 degree centigrade in g\n",
      "t1 = 60.  # The temperature of 10 g water in degree centigrade\n",
      "t2 = 20.  # The temperature of 30 g water in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of 10g water in K\n",
      "T2 = t2 + 273  # The temperature of 30g water in K\n",
      "T = ((m1 * T1) + (m2 * T2)) / (m1 + m2)  # The final temperature of water in K\n",
      "# The change in entropy of 10g water from 333 to 303 K in cal/K\n",
      "s1 = m1 * math.log(T / T1)\n",
      "# The change in entropy of 30g water from 293 to 303 K in cal/K\n",
      "s2 = m2 * math.log(T / T2)\n",
      "s = s1 + s2  # The total gain in the entropy of the system in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The change in entropy is %3.4f cal/K ' % (s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in entropy is 0.0627 cal/K \n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.17  Page No : 629"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# input data\n",
      "m = 10.  # The given amount of water in kg\n",
      "t1 = 100.  # The temperature of water in degree centigrade\n",
      "L = 540.  # The latent heat of vapourisation of steam in cal\n",
      "\n",
      "# Calculations\n",
      "m1 = m * 1000  # The given amount of water in g\n",
      "T1 = t1 + 273  # The temperature of water in K\n",
      "S = (m1 * L) / T1  # The increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in entropy is %3.0f cal/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in entropy is 14477 cal/K \n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.18  Page No : 634"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 50.  # The given amount of water in g\n",
      "t1 = 10.  # The initial temperature of water in degree centigrade\n",
      "t2 = 90.  # The final temperature of water in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The initial temperature of water in K\n",
      "T2 = t2 + 273  # The final temperature of water in K\n",
      "S = m * math.log(T2 / T1)  # The increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in entropy is %3.3f cal/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in entropy is 12.448 cal/K \n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.19  Page No : 640"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 10.  # The given amount of ice in g\n",
      "T1 = 273.  # The initial temperature of ice in K\n",
      "T2 = 373.  # The final temperature of steam in K\n",
      "L1 = 80.  # The latent heat of ice in cal/g\n",
      "L2 = 540.  # The latent heat of vapourisation of steam in cal\n",
      "\n",
      "# Calculations\n",
      "s1 = (m * L1) / T1  # Increase in entropy from ice at 273K to water at 273K in cal/K\n",
      "# Increase in entropy from water at 273K to water at 373K in cal/K\n",
      "s2 = (m) * math.log(T2 / T1)\n",
      "# Increase in entropy from water at 373K to steam at 373K in cal/K\n",
      "s3 = (m * L2) / T2\n",
      "s = s1 + s2 + s3  # The total increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The total increase in entropy is %3.2f cal/K ' % (s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total increase in entropy is 20.53 cal/K \n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.20  Page No : 645"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 1.  # The given amount of nitrogen in g\n",
      "t1 = 50.  # The initial temperature of nitrogen in degree centigrade\n",
      "t2 = 100.  # The final temperature of nitrogen in degree centigrade\n",
      "Cv = 0.18  # Molar specific heat of nitrogen\n",
      "w = 28.  # Molecular weight of nitrogen\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The initial temperature of nitrogen in K\n",
      "T2 = t2 + 273  # The final temperature of nitrogen in K\n",
      "S = (Cv / w)  # The Specific heat of nitrogen\n",
      "s = m * S * math.log(T2 / T1)  # The change in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The change in entropy is %3.4g cal/K ' % (s)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in entropy is 0.0009252 cal/K \n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.21  Page No : 650"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "p = 135.2  # The given increase in the pressure in atmospheres\n",
      "V = -0.091  # The given increase in the specific volume when 1g of water freezes into ice in cm**3\n",
      "L = 80.  # Latent heat of fusion of ice in cal/gram\n",
      "T = 273.  # The temperature of ice in K\n",
      "\n",
      "# Calculations\n",
      "L1 = L * 4.18 * 10**7  # The latent heat of fusion of ice in ergs/g\n",
      "P = p * 1.013 * 10**6  # The given increase in the pressure in dynes/cm**2\n",
      "# The temperature at which ice will freeze in degree centigrade\n",
      "t = (P * T * V) / L1\n",
      "t1 = t + 273  # The temperature at which ice will freeze in K\n",
      "\n",
      "# Calculations\n",
      "print 'The temperature at which ice will freeze is %3.0f degree centigrade (or) %3.0f K ' % (t, t1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature at which ice will freeze is  -1 degree centigrade (or) 272 K \n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.22  Page No : 655"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 1.  # The given amount of water in kg\n",
      "s = 1000.  # The specific heat of water in cal/kg-K\n",
      "T1 = 273.  # The initial temperature of water in K\n",
      "T2 = 373.  # The temperature of the heat reservoir in K\n",
      "\n",
      "# Calculations\n",
      "S = m * s * math.log(T2 / T1)  # The increase in entropy in cal/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in the entropy of water is %3.0f cal/K' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in the entropy of water is 312 cal/K\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.23  Page No : 661"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# input data\n",
      "m = 0.0273  # The given amount of ice in kg\n",
      "L = 80.  # The latent heat of fusion of ice in cal/gram\n",
      "T = 273.  # The temperature of ice in K\n",
      "\n",
      "# Calculations\n",
      "L1 = L * 1000  # The latent heat of fusion of ice in cal/kg\n",
      "S = (m * L1 * 4.2) / T  # The change in entropy in J/K\n",
      "\n",
      "# Output\n",
      "print 'The change in entropy is %3.1f J/K' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in entropy is 33.6 J/K\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.24  Page No : 667"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "t1 = 27.  # The given initial temperature in degree centigrade\n",
      "p = 50.  # The reduce in the pressure in atmospheres\n",
      "a = 13.2 * 10**-2  # Van der Waals constant in Nm**4mole**-2\n",
      "b = 31.2 * 10**-6  # Van der Waals constant in mole**-1m**3\n",
      "R = 8.3  # Universal gas constant in JK**-1(mole)**-1\n",
      "Cp = 3.5  # The specific heat at constant pressure\n",
      "M = 32.  # Molecular weight of oxygen\n",
      "\n",
      "# Calculations\n",
      "T = t1 + 273  # The given initial temperature in K\n",
      "P = p * 0.76 * 13.6 * 1000 * 9.8  # The reduce in the pressure in N/m**2\n",
      "# The drop in the temperature in K\n",
      "T1 = ((P) / (4.2 * M * Cp * R)) * (((2 * a) / (R * T)) - b)\n",
      "\n",
      "# Output\n",
      "print 'The drop in the temperature is %3.4f K ' % (T1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drop in the temperature is 0.0971 K \n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.25  Page No : 674"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "T = 300.  # The temperature of the metallic copper disc in K\n",
      "Cp = 24.5  # The specific heat at constant pressure in J/mol K\n",
      "a = 50.4 * 10**-6  # The coefficient of thermal expansion in K**-1\n",
      "K = 7.78 * 10**-12  # Isothermal compressibility in N/m**2\n",
      "V = 7.06 * 10**-6  # The specific volume in m**3/mol\n",
      "\n",
      "# Calculations\n",
      "C = (T * V * a**2) / K  # The change in specific heats in J/mol K\n",
      "Cv = Cp - C  # The specific heat at constant volume in J/mol K\n",
      "\n",
      "# Output\n",
      "print 'The specific heat at constant volume is Cv = %3.4f J/mol-K ' % (Cv)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The specific heat at constant volume is Cv = 23.8085 J/mol-K \n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.26  Page No : 676"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "p = 50.  # The reduced pressure in atmospheres\n",
      "t = 27.  # The initial temperature of the gas in degree centigrade\n",
      "a = 1.32 * 10**12  # Van der Waal constant a in cm**4 dynes/mole**2\n",
      "b = 31.2  # Van der Waal constant b in cm**3/mole\n",
      "Cp = 7.  # The specific heat at constant pressure in cal/mole-K\n",
      "\n",
      "# Calculations\n",
      "P = p * 76 * 13.6 * 980  # The reduced pressure in dynes/cm**2\n",
      "Cp1 = Cp * 4.2 * 10**7  # The specific heat at constant pressure in ergs/mole-K\n",
      "T = t + 273  # The initial temperature of the gas in K\n",
      "R = 8.31 * 10**7  # The real gas constant in ergs/mole-K\n",
      "# The drop in temperature in K or degree centigrade\n",
      "dT = (P / Cp1) * (((2 * a) / (R * T)) - b)\n",
      "\n",
      "# Output\n",
      "print 'The drop in temperature produced by adiabatic throttling process is %3.3f K  (or) %3.3f degree centigrade ' % (dT, dT)\n",
      "\n",
      "# Error . There is a change in the result compared to the textbook because\n",
      "# the final calculations did in the textbook went wrong , so the final\n",
      "# result varied from the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The drop in temperature produced by adiabatic throttling process is 12.868 K  (or) 12.868 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.27  Page No : 678"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "t = 0.  # The initial temperature of mercury in degree centigrade\n",
      "p = 1.  # The initial pressure of mercury in atmospheres\n",
      "Cp = 28.  # The specific heat at constant pressure in J/mol K\n",
      "V = 1.47 * 10**-5  # The given specific volume in m**3/mol\n",
      "b = 1.81 * 10**-6  # The given volume expansivity in K**-1\n",
      "k = 3.89 * 10**-11  # The given compressibility in pa**-1\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The initial temperature of mercury in K\n",
      "# The specific heat at constant volume in J/mol K\n",
      "Cv = Cp - ((T * V * b**2) / k)\n",
      "g = Cp / Cv  # The adiabatic index\n",
      "\n",
      "# Output\n",
      "print 'The adiabatic index is %3.0f ' % (g)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The adiabatic index is   1 \n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.28  Page No : 681"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "K = 24. * 10**-3  # The coefficient of thermal conductivity of an oxygen molecule in J/m.s.K\n",
      "Cv = 20.9 * 10**3  # The specific heat at constant volume in J/kilo.mole.K\n",
      "k = 1.38 * 10**-23  # The boltzmanns constant in J/K\n",
      "m = 5.31 * 10**-26  # The mass of an oxygen molecule in kg\n",
      "T = 273.  # The temperature of the molecule in K\n",
      "pi = 3.142  # Mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "C = ((3 * k * T) / m)**(1. / 2)  # The velocity of the molecule in m\n",
      "r = (((3 * k * T * m)**(1. / 2) * Cv) / (3. * 2.**(1. / 2) * pi * K)\n",
      "     )**(1. / 2)  # The radius of an oxygen molecule in m\n",
      "\n",
      "# Output\n",
      "print 'The radius of an oxygen molecule is  %3.4g m ' % (r)\n",
      "\n",
      "# Error . There is a change in the result compared to the textbook because\n",
      "# the final calculations did in the textbook went wrong , so the final\n",
      "# result varied from the textbook\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The radius of an oxygen molecule is  1.265e-09 m \n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.29  Page No : 687"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "b = 0.3  # The given wiens constant in cm-K\n",
      "l = 5500.  # The given wavelength in A units\n",
      "\n",
      "# Calculations\n",
      "L = l * 10**-8  # The given wavelength in cm\n",
      "T = b / L  # The temperature of the sun in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature of the sun is  %3.0f K ' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature of the sun is  5455 K \n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.30  Page No : 692"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "R = 1. * 10**4  # The rate at which black body loses thermal energy in watts/m**2\n",
      "s = 5.672 * 10**-8  # Stefans constant in SI units\n",
      "\n",
      "# Calculations\n",
      "T = (R / s)**(1. / 4)  # The temperature of the black body in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature of the black body is  %3.0f K' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature of the black body is  648 K\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.31  Page No : 697"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T = 6174.  # The temperature of the black body in K\n",
      "l = 4700.  # The wavelength of the black body emitting in amstrong units\n",
      "l1 = 1.4 * 10**-5  # The wavelength to be emitted by the black body in m\n",
      "\n",
      "# Calculations\n",
      "L = l * 10**-10  # The wavelength of the black body emitted at 6174 K in m\n",
      "L1 = l1  # The wavelength to be emitted by the black body in m\n",
      "T1 = (L * T) / L1  # The temperature to be maintained by the black body in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature to be maintained by the black body is %3.2f K ' % (T1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature to be maintained by the black body is 207.27 K \n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.32  Page No : 701"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "T = 5800.  # The temperature of the sun in K\n",
      "\n",
      "# Calculations\n",
      "r = 7. * 10**8  # The radius of the sun in m\n",
      "pi = 3.142  # The mathematical constant of pi\n",
      "A = 4. * pi * r**2  # The surface area of the sun in m**2\n",
      "s = 5.672 * 10**-8  # Stefans constant in SI units\n",
      "U = A * s * T**4  # The total energy emitted by sun per second in J\n",
      "r1 = 1.5 * 10**11  # The distance of the earths atmosphere from the sun in m\n",
      "# Energy reaching the top of earths atmosphere in kW/m**2\n",
      "R = (U / (4 * pi * r1**2)) / 1000\n",
      "\n",
      "# Output\n",
      "print 'The total radiant energy emitted by sun per second is  %3.4g J  \\\n",
      "\\nThe rate at which energy is reaching earths atmosphere is  %3.1f kW/m^2 ' % (U, R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total radiant energy emitted by sun per second is  3.953e+26 J  \n",
        "The rate at which energy is reaching earths atmosphere is  1.4 kW/m^2 \n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.33  Page No : 706"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "n = 5.  # The molecules of ozone in grams\n",
      "t = 27.  # The temperature of ozone in degree centigrade\n",
      "R = 8.3  # The universal gas constant in J/g-mol/K\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The temperature of ozone in K\n",
      "U = n * ((3. / 2) * R * T)  # The energy of ozone in J\n",
      "\n",
      "# Output\n",
      "print 'The energy of 5 gms molecules of ozone at 27 degree centigrade is  %3.6g J ' % (U)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy of 5 gms molecules of ozone at 27 degree centigrade is  18675 J \n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.34  Page No : 708"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t = -1  # The pressure required to lower the melting point of ice in K\n",
      "l = 79.6  # The latent heat of ice in cal/g\n",
      "V1 = 1.  # The specific volumes of water at 0 degree centigrade in cm**2\n",
      "V2 = 1.091  # The specific volumes of ice at 0 degree centigrade in cm**2\n",
      "p = 1.013 * 10**6  # One atmospheric pressure in dyne/cm**2\n",
      "\n",
      "# Calculations\n",
      "T = 273.  # The temperature of water in K\n",
      "L = l * 4.18 * 10**7  # The latent heat of ice in ergs/g\n",
      "p1 = (L * t) / (T * (V1 - V2))  # The obtained pressure in dynes/cm**2\n",
      "P = p1 / p  # The obtained pressure in atmospheres\n",
      "P1 = P + 1  # The required pressure in atmospheres\n",
      "\n",
      "# Output\n",
      "print 'The pressure required is  %3.2f atmospheres ' % (P1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The pressure required is  133.21 atmospheres \n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.35  Page No : 710"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 127.  # The temperature of the black body in degree centigrade\n",
      "t2 = 27.  # The temperature of the walls maintained in degree centigrade\n",
      "s = 5.672 * 10**-8  # Stefans constant in SI units\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the black body in K\n",
      "T2 = t2 + 273  # The temperature of the walls maintained in K\n",
      "R = s * (T1**4 - T2**4)  # The net amount of energy lost by body in W/m**2\n",
      "\n",
      "# Output\n",
      "print 'The net amount of energy lost by body per sec per unit area is  %3.1f watts/m^2' % (R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The net amount of energy lost by body per sec per unit area is  992.6 watts/m^2\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.36  Page No : 713"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t2 = 7.  # The low temperature of reservoir in degree centigrade\n",
      "n1 = 50.  # The efficiency of the carnots engine in percentage\n",
      "n2 = 70.  # The increased efficiency of the carnots engine in percentage\n",
      "\n",
      "# Calculations\n",
      "T2 = t2 + 273  # The low temperature of the reservoir in K\n",
      "T1 = T2 / (1 - (n1 / 100))  # The temperature of the source reservoir in K\n",
      "# The temperature to be maintained by the source reservoir in K\n",
      "T11 = T2 / (1 - (n2 / 100))\n",
      "T = T11 - T1  # The increase in temperature of the source in K or degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The increase in temperature of the source is  %3.1f K (or) %3.1f degree centigrade ' % (T, T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in temperature of the source is  373.3 K (or) 373.3 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.37  Page No : 717"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "T1 = 6174.  # The temperature of the black body in K\n",
      "l1 = 4700.  # The wavelength emitted by the black body in amstrong units\n",
      "l2 = 1400.  # The wavelength to be emitted by the black body in amstrong units\n",
      "\n",
      "# Calculations\n",
      "T2 = (l1 * T1) / l2  # The temperature to be maintained by the black body in K\n",
      "\n",
      "# Output\n",
      "print 'The temperature to be maintained by the black body is  %3.0f K ' % (T2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature to be maintained by the black body is  20727 K \n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.38  Page No : 723"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "e = 8.5 * 10**28  # The given energy density of electrons in copper in electrons/m**3\n",
      "k = 1.38 * 10**-23  # The boltzmann constant in J/K\n",
      "h = 6.62 * 10**-34  # Planks constant in J.s\n",
      "m = 9.1 * 10**-31  # The given mass of electrons in kg\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "E = (((3 * e) / pi)**(2. / 3)) * (h**2) * (1. / 8) * \\\n",
      "    (1 / m)  # The fermi energy for copper in J\n",
      "EF = E / (1.6 * 10**-19)  # The fermi energy for copper in eV\n",
      "\n",
      "# Output\n",
      "print 'The fermi energy for copper at absolute zero is  %3.3f eV ' % (EF)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The fermi energy for copper at absolute zero is  7.056 eV \n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.39  Page No : 725"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 100.  # The temperature of the source in degree centigrade\n",
      "t2 = 0.  # The temperature of the sinkk in degree centigrade\n",
      "P = 100.  # The power of the engine in watts (or) J/s\n",
      "l = 80.  # The latent heat of ice in cal/g\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the source in K\n",
      "T2 = t2 + 273  # The temperature of the sinkk in K\n",
      "L = l * 4.2 * 10**3  # The latent heat of ice in ergs/kg\n",
      "W = P * 60  # The amount of work done in one minute in J\n",
      "H2 = (W * T2) / (T1 - T2)  # The amount of heat at the sinkk in J\n",
      "m = (H2 / L)  # The amount of ice melts in kg\n",
      "\n",
      "# Output\n",
      "print 'The amount of ice that will melt in one minute is  %3.5f kg ' % (m)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of ice that will melt in one minute is  0.04875 kg \n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.40  Page No : 730"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "C1 = 1.84  # The RMS speed of molecules of hydrogen at NTP in km/s\n",
      "p1 = 2.  # The molecular weight of hydrogen\n",
      "p2 = 32.  # The molecular weight of oxygen\n",
      "\n",
      "# Calculations\n",
      "C2 = C1 * (p1 / p2)**(1. / 2)  # The RMS speed of oxygen at NTP in km/s\n",
      "C21 = C2 * 1000  # The RMS speed of oxygen at NTP in m/s\n",
      "\n",
      "# Output\n",
      "print 'The RMS speed of oxygen at NTP is  %3.2f km/s (or) %3.0f m/s ' % (C2, C21)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The RMS speed of oxygen at NTP is  0.46 km/s (or) 460 m/s \n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.41  Page No : 737"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t = 101.  # The temperature at which water boils in degree centigrade\n",
      "p = 787.  # The pressure maintained at water boils in mm of Hg\n",
      "t1 = 100.  # Normal boiling point of water in degree centigrade\n",
      "T = t1 + 273  # Normal boiling point of water in K\n",
      "p1 = 760.  # The normal maintained pressure in mm of Hg\n",
      "V2 = 1601.  # The specific volume of water evaporation in cm**3\n",
      "V1 = 1.  # The specific volume of water in cm**3\n",
      "\n",
      "# Calculations\n",
      "V = V2 - V1  # The change in specific volume in cm**3\n",
      "dT = t - t1  # The change in temperature in degree centigrade or K\n",
      "dP = (p - p1) / 10  # The change in pressure in cm of Hg\n",
      "L = (T * dP * 13.6 * 980 * V) / dT  # Latent heat of steam in ergs/g\n",
      "L1 = L / (4.2 * 10**7)  # The latent heat of steam in cal/g\n",
      "\n",
      "# Output\n",
      "print 'The latent heat of steam is  %3.4g ergs/g  (or) %3.2f cal/g ' % (L, L1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The latent heat of steam is  2.148e+10 ergs/g  (or) 511.34 cal/g \n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.42  Page No : 742"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 7.7 * 10**3  # The density of aluminium in kg/m**3\n",
      "w = 27.  # The atomic weight of Al in kg/k.mol\n",
      "N = 6.023 * 10**26  # The number of free electrons in Al\n",
      "k = 1.38 * 10**-23  # The boltzmann constant in J/K\n",
      "h = 6.62 * 10**-34  # Planks constant in J.s\n",
      "m = 9.1 * 10**-31  # The given mass of electrons in kg\n",
      "pi = 3.14  # The testematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "V = w / d  # The volume occupied by Al in m**3/k.mol\n",
      "E = (((3 * (N / V)) / pi)**(2. / 3)) * (h**2) * (1. / 8) * \\\n",
      "    (1 / m)  # The fermi energy for aluminium in J\n",
      "EF = E / (1.6 * 10**-19)  # The fermi energy for aluminium in eV\n",
      "# The pressure of electrons in aluminium at absolute zero in N/m**2\n",
      "p = (2. / 3) * (N / V) * (E)\n",
      "\n",
      "# Output\n",
      "print 'The fermi energy for aluminium at absolute zero is  %3.3f eV  \\\n",
      "\\nThe pressure of electrons in aluminium at absolute zero is  %3.4g N/m^2' % (EF, p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The fermi energy for aluminium at absolute zero is  11.278 eV  \n",
        "The pressure of electrons in aluminium at absolute zero is  2.066e+11 N/m^2\n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.43  Page No : 747"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t2 = 20.  # The temperature of room in degree centigrade\n",
      "t1 = 37.  # The skin temperature of the boy in degree centigrade\n",
      "t = 10.  # The given time in min\n",
      "A = 3.  # The surface area of the student in m**2\n",
      "e = 0.9  # The emissivity of the student\n",
      "\n",
      "# Calculations\n",
      "T2 = t2 + 273  # The temperature of the room in K\n",
      "T1 = t1 + 273  # The skin temperature of the boy in K\n",
      "t1 = t * 60  # The given time in sec\n",
      "s = 5.67 * 10**-8  # Stefans constant in W/m**2-K**4\n",
      "R = e * A * s * (T1**4 - T2**4)  # Heat loss by the skin in one second in J/s\n",
      "Q = R * t1  # Total heat loss by the skin in 10 minutes in J\n",
      "\n",
      "# Output\n",
      "print 'The total heat loss by the skin in 10 minutes is  %3.4g J ' % (Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total heat loss by the skin in 10 minutes is  1.713e+05 J \n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.44  Page No : 751"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 20.  # The temperature of the air in the cylinder of a combustion engine in degree centigrade\n",
      "p1 = 1.  # The initial pressure of the air in atmospheres\n",
      "V1 = 8. * 10**-4  # The initial volume of the air in m**3\n",
      "V2 = 6. * 10**-5  # The final volume of the air in m**3\n",
      "g = 1.4  # The adiabatic index\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the air in K\n",
      "p2 = p1 * (V1 / V2)**(g)  # The final pressure of the gas in atmospheres\n",
      "T2 = (p2 / p1) * (V2 / V1) * T1  # The final temperature of the gas in K\n",
      "T21 = T2 - 273  # The final temperature of the gas in degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The final pressure of the gas is  %3.1f atmospheres  \\\n",
      "\\nThe final temperature of the gas is  %3.1f K  (or) %3.1f degree centigrade ' % (p2, T2, T21)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The final pressure of the gas is  37.6 atmospheres  \n",
        "The final temperature of the gas is  825.7 K  (or) 552.7 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.47  Page No : 757"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "d = 2. * 10**-10  # The molecular diameter of an ideal gas in m\n",
      "t = 20.  # The temperature of the gas in degree centigrade\n",
      "p = 1.  # The pressure of the gas in atmosphere\n",
      "pi = 3.142  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "T = t + 273  # The temperature of the gas in K\n",
      "P = 1.01 * 10**5  # The pressure of the gas in N/m**2\n",
      "v = 511.  # The velocity of the molecules at 20 degree centigrade in m/s\n",
      "k = 1.38 * 10**-23  # Boltzman constant in J/K\n",
      "n = P / (k * T)  # The number of molecules per m**3\n",
      "l = 1. / (1.414 * pi * d**2 * n)  # The mean free path in m\n",
      "f = v / l  # The collision frequency in per second\n",
      "\n",
      "# Output\n",
      "print '(a)The mean free path is  %3.4g m  \\n (b)The collision frequency is  %3.4g per second ' % (l, f)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The mean free path is  2.253e-07 m  \n",
        " (b)The collision frequency is  2.268e+09 per second \n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.48  Page No : 760"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "l = 1.876 * 10**-7  # The mean free path of the gas in m\n",
      "v = 511.  # The average speed of the molecule in m/s\n",
      "\n",
      "# Calculations\n",
      "f = v / l  # The collision frequency in per second\n",
      "\n",
      "# Output\n",
      "print 'The collision frequency is  %3.4g per second ' % (f)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The collision frequency is  2.724e+09 per second \n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.49  Page No : 764"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "s = 1.  # The specific heat of water in k cal kg C\n",
      "m = 1.  # The mass of ice in kg\n",
      "H = 80.  # The latent heat of ice in kcal/kg\n",
      "H1 = 540.  # The latent heat of steam in kcal/kg\n",
      "T = 273.  # The temperature of the ice in K\n",
      "T1 = 373.  # The temperature of water at 100 degree centigrade in K\n",
      "\n",
      "# Calculations\n",
      "S1 = H / T  # The increase in entropy when 1 kg of ice at 273 K is converted into water at 273 K in kcal/K\n",
      "# The increase in entropy when 1 kg of water at 273 K is converted into\n",
      "# water at 373 K in kcal/K\n",
      "S2 = m * s * math.log(T1 / T)\n",
      "S3 = H1 / T1  # The increase in entropy when 1 kg of water at 373 K is converted into steam at 373 K in kcal/K\n",
      "S = S1 + S2 + S3  # The total increase in entropy in kcal/K\n",
      "\n",
      "# Output\n",
      "print 'The total increase in entropy is  %3.3f kcal/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total increase in entropy is  2.053 kcal/K \n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.50  Page No : 767"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 27.  # The initial temperature of the gas in degree centigrade\n",
      "g = 1.4  # The adiabatic index\n",
      "p1 = 1.  # Let the initial pressure in atmospheres\n",
      "p2 = 2. * p1  # The final pressure in atmospheres\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The initial temperature of the gas in K\n",
      "# The final temperature of the gas in K\n",
      "T2 = (((p2 / p1)**(g - 1)) * (T1)**g)**(1 / g)\n",
      "T = T2 - T1  # The rise in temperature of a gas in K or degree centigrade\n",
      "\n",
      "# Output\n",
      "print 'The rise in temperature is  %3.1f degree centigrade ' % (T)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rise in temperature is  65.7 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.51  Page No : 770"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "V1 = 10.**-3  # One litre of monoatomic perfect gas at NTP in m**3\n",
      "V2 = (V1 / 2)  # The final volume in m**3\n",
      "g = 1.67  # The adiabatic index\n",
      "\n",
      "# Calculations\n",
      "# The work done on the gas in J\n",
      "W = (1 / (g - 1)) * ((1 / (V2)**(g - 1)) - (1 / (V1)**(g - 1)))\n",
      "\n",
      "# Output\n",
      "print 'The work done on the gas is  %3.1f J ' % (W)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The work done on the gas is  90.3 J \n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.52  Page No : 775"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "T1 = 1200.  # The temperature at which first engine receives heat in K\n",
      "T2 = 300.  # The temperature at which second engine rejects to heat reservoir in K\n",
      "\n",
      "# Calculations\n",
      "# The temperature when the work outputs of two engines are equal in K\n",
      "Tw = (T1 + T2) / 2\n",
      "# The temperature when the efficiency of two engines are equal in K\n",
      "Te = (T1 * T2)**(1. / 2)\n",
      "\n",
      "# Output\n",
      "print '(a)The temperature when the work outputs of two engines are equal is  %3.0f K \\n (b)The temperature when the efficiency of two engines are equal is  %3.0f K ' % (Tw, Te)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The temperature when the work outputs of two engines are equal is  750 K \n",
        " (b)The temperature when the efficiency of two engines are equal is  600 K \n"
       ]
      }
     ],
     "prompt_number": 57
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.53  Page No : 777"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "t1 = 27.  # The temperature of the source in degree centigrade\n",
      "t2 = -73  # The temperature of the sinkk in degree centigrade\n",
      "H2 = 300.  # The amount of heat released by the sinkk in cal\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the source in K\n",
      "T2 = t2 + 273  # The temperature of the sinkk in K\n",
      "H1 = H2 * (T1 / T2)  # The amount of heat released by the source in cal\n",
      "W = H1 - H2  # The work performed per cycle in cal\n",
      "W1 = W * 4.2  # The work performed per cycle in J\n",
      "\n",
      "# Output\n",
      "print 'The work performed by the engine per cycle is  %3.0f J ' % (W1)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The work performed by the engine per cycle is  630 J \n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.54  Page No : 782"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Input data\n",
      "m = 3.  # The rate at which ice melts in kg/hour\n",
      "t = 28.  # The external temperature in degree centigrade\n",
      "Li = 3.3 * 10**5  # Specific latent heat of ice fusion in Jkg**-1\n",
      "s = 4.2 * 10**3  # The specific heat in Jkg**-1.C\n",
      "\n",
      "# Calculations\n",
      "Q = (m * Li) + (m * s * t)  # The heat taken by the ice to melt into water in J\n",
      "P = Q / 3600  # To prevent melting of ice ,the refrigerator should have the power out in J/s\n",
      "\n",
      "# Output\n",
      "print 'The minimum power output of the motor is  %3.0f watts ' % (P)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum power output of the motor is  373 watts \n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.55  Page No : 788"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "Li = 3.3 * 10**5  # Specific latent heat of ice fusion in Jkg**-1\n",
      "V1 = 1.090 * 10**-3  # The specific volume of one kg of ice in m**3\n",
      "V2 = 10.**-3  # The specific volume of one kg of water in m**3\n",
      "T = 273.  # The temperature maintained in K\n",
      "dP = 1.01 * 10**5  # The increase in pressure in N/m**2\n",
      "\n",
      "# Calculations\n",
      "# The depression in the melting point of ice in K (or) degree centigrade\n",
      "dT = -(dP * T * (V2 - V1)) / Li\n",
      "\n",
      "# Output\n",
      "print 'The depression of melting point of ice is  %3.2g K  (or) %3.2g degree centigrade ' % (dT, dT)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The depression of melting point of ice is  0.0075 K  (or) 0.0075 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.56  Page No : 791"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "dp = 100.  # The change in mercury pressure in cm of Hg\n",
      "v2 = 1601.  # Specific volume of steam in cm**3/gram\n",
      "v1 = 1.  # Specific volume of water in cm**3/gram\n",
      "l = 536.  # Latent heat in cal/gram\n",
      "t = 100.  # The temperature of the steam in degree centigrade\n",
      "\n",
      "# calculations\n",
      "dP = 1. * 13.6 * 10**3 * 9.8  # The change in mercury pressure in N/m**2\n",
      "V2 = v2 * 10**-3  # Specific volume of steam in m**3/kg\n",
      "V1 = v1 * 10**-3  # Specific volume of water in m**3/kg\n",
      "L = l * 4.2 * 10**3  # Latent heat in J/kg\n",
      "T = t + 273  # The temperature of the steam in K\n",
      "# The increase in boiling point of water in K or degree centigrade\n",
      "dT = (dP * T * (V2 - V1)) / L\n",
      "\n",
      "# Output\n",
      "print 'The increase in boiling point of water is  %3.2f K  (or) %3.2f degree centigrade ' % (dT, dT)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in boiling point of water is  35.33 K  (or) 35.33 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.57  Page No : 796"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "L = 80.  # The latent heat of fusion of ice in cal/gm\n",
      "Li = 3.3 * 10**5  # Specific latent heat of ice fusion in Jkg**-1\n",
      "dp = 1.  # The increase in pressure in atmospheres\n",
      "t = 0.  # The given temperature in degree centigrade\n",
      "v = -0.1  # The change in specific volume in cm**3/gm\n",
      "\n",
      "# Calculations\n",
      "dP = 0.76 * 13.6 * 10**3 * 9.8  # The increase in pressure in N/m**2\n",
      "V = v * 10**-3  # The change in specific volume in m**3/kg\n",
      "T = t + 273  # The given temperature in K\n",
      "# The decrease in the melting point of ice with increase in the pressure\n",
      "# of one atmosphere in K\n",
      "dT = -(dP * T * (V)) / Li\n",
      "\n",
      "# Output\n",
      "print 'The decrease in melting point of ice is  %3.4f K  (or) %3.4f degree centigrade ' % (dT, dT)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The decrease in melting point of ice is  0.0084 K  (or) 0.0084 degree centigrade \n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.58  Page No : 803"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "R = 8.4  # The universal gas constant in J.mol**-1.K**-1\n",
      "Cv = 21.  # The spacific heat at constant volume in J.mol**-1.K**-1\n",
      "P1 = 2. * 10**5  # The initial pressure of gas in N/m**2\n",
      "V1 = 20.  # The initial volume of the gas occupied in litres\n",
      "P2 = 5. * 10**5  # The final pressure of the gas in N/m**2\n",
      "V2 = 50.  # The final volume of the gas occupied in litres\n",
      "\n",
      "# Calculations\n",
      "# The ratio of final temperature to the initial temperature for perfect gas\n",
      "T = (P2 * V2) / (P1 * V1)\n",
      "V = V2 / V1  # The ratio of final volume to the initial volume for perfect gas\n",
      "S = (Cv * math.log(T)) + (R * math.log(V))  # The change of entropy in J/K\n",
      "\n",
      "# Output\n",
      "print 'The increase in entropy is  %3.2f J/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The increase in entropy is  46.18 J/K \n"
       ]
      }
     ],
     "prompt_number": 61
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.59  Page No : 807"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "s = 4.2 * 10**3  # The specific heat of water is J/kg.C\n",
      "m1 = 0.1  # The mass of water at 15 degree centigrade in kg\n",
      "m2 = 0.16  # The mass of water at 40 degree centigrade in kg\n",
      "t1 = 15.  # The temperature of the first water in degree centigrade\n",
      "t2 = 40.  # The temperature of the second water in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of the first water in K\n",
      "T2 = t2 + 273  # The temperature of the second water in K\n",
      "T = ((m1 * T1) + (m2 * T2)) / (m1 + m2)  # The final mixed temperature in K\n",
      "# The change in entropy for 0.1 kg of water in J/K\n",
      "s1 = m1 * s * 2.3026 * math.log10(T / T1)\n",
      "# The change in entropy for 0.16 kg of water in J/K\n",
      "s2 = m2 * s * 2.3026 * math.log10(T / T2)\n",
      "S = s1 + s2  # The net change in the entropy of the system in J/K\n",
      "\n",
      "# Output\n",
      "print 'The net increase in entropy is  %3.2f J/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The net increase in entropy is  0.89 J/K \n"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.60  Page No : 811"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "m = 12.5 * 10**-3  # The amount of ice in kg\n",
      "li = 80.  # Latent heat of ice in cal/gram\n",
      "l = 536.  # Latent heat of steam in cal/gram\n",
      "si = 0.5  # Specific heat of ice in cal/gram-K\n",
      "sw = 1.  # Specific heat of water in cal/gram-K\n",
      "T1 = -24 + 273  # The initial temperature of ice in K\n",
      "T2 = 0. + 273  # The final temperature of ice in K\n",
      "T3 = 100. + 273  # The final temperature of water in K\n",
      "\n",
      "# Calculations\n",
      "Li = li * 10**3 * 4.2  # The latent heat of ice in J/kg\n",
      "Ls = l * 10**3 * 4.2  # The latent heat of water in J/kg\n",
      "Si = si * 10**3 * 4.2  # The specific heat of ice in J/kg-K\n",
      "Sw = sw * 10**3 * 4.2  # The specific heat of water in J/kg-K\n",
      "# The increase in entropy of ice from 249 K to 273 K in J/K\n",
      "s1 = m * Si * math.log(T2 / T1)\n",
      "s2 = (m * Li) / T2  # The increase in entropy from 273 K ice to 273 K water in J/K\n",
      "# The increase in entropy of water from 273 K to 373 K in J/K\n",
      "s3 = m * Sw * math.log(T3 / T2)\n",
      "# The increase in entropy from water at 373 K to steam at 373 K in J/K\n",
      "s4 = (m * Ls) / T3\n",
      "S = s1 + s2 + s3 + s4  # The total increase in entropy in J/K\n",
      "\n",
      "# Output\n",
      "print 'The total increase in entropy is  %3.2f J/K ' % (S)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total increase in entropy is  109.63 J/K \n"
       ]
      }
     ],
     "prompt_number": 63
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.61  Page No : 813"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "x1 = 20.  # The initial thickness of the layer in cm\n",
      "x2 = 30.  # The final thickness of the layer in cm\n",
      "t1 = -15  # The temperature of the surroundings in degree centigrade\n",
      "L = 80.  # The latent heat of ice in cal/gram\n",
      "d = 0.9  # The given density of ice in g/cm**3\n",
      "K = 0.005  # The coefficient of thermal conductivity in C.G.S units\n",
      "\n",
      "# Calculations\n",
      "t = ((d * L) / (2 * K * t1)) * (x1**2 - x2**2)  # The time taken in sec\n",
      "\n",
      "# Output\n",
      "print 'The time taken for a layer of ice to increase the thickness is  %3.2g sec ' % (t)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time taken for a layer of ice to increase the thickness is  2.4e+05 sec \n"
       ]
      }
     ],
     "prompt_number": 64
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.62  Page No : 815"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "t1 = 121.  # The temperature of solid copper sphere in degree centigrade\n",
      "dt1 = 2.6  # The rate of cooling of copper sphere in degree centigrade per minute\n",
      "t2 = 195.  # The temperature of another solid sphere in degree centigrade\n",
      "t = 30.  # The surrounding temperature in degree centigrade\n",
      "\n",
      "# Calculations\n",
      "T1 = t1 + 273  # The temperature of solid copper sphere in K\n",
      "T2 = t2 + 273  # The temperature of another solid copper sphere in K\n",
      "T0 = t + 273  # The surrounding temperature in K\n",
      "R1 = 1.  # Let the radius of the first sphere in m\n",
      "R2 = 2. * R1  # The radius of the second sphere in m\n",
      "# The rate at which solid copper sphere cools in degree centigrade per minute\n",
      "dt2 = (dt1) * (R1 / R2) * ((T2**4 - T0**4) / (T1**4 - T0**4))\n",
      "\n",
      "# Output\n",
      "print 'The rate at which solid copper sphere cools is  %3.3f degree centigrade per minute ' % (dt2)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate at which solid copper sphere cools is  3.281 degree centigrade per minute \n"
       ]
      }
     ],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.63  Page No : 820"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Input data\n",
      "dt = 250.  # The temperature gradient of an insulated copper rod in degree centigrade per metre\n",
      "x = 0.05  # The distance between the two points in m\n",
      "K = 384.  # The thermal conductivity of copper in W.m**-1.K**-1\n",
      "A = 1.  # The surface area of the copper rod in m**2\n",
      "t = 1.  # The given time in seconds\n",
      "\n",
      "# Calculations\n",
      "T = dt * x  # The temperature difference in degree centigrade\n",
      "# The amount of heat crossed per unit area per sec in J/s\n",
      "Q = K * A * (dt) * t\n",
      "\n",
      "# Output\n",
      "print '(1)The difference in temperature between two points seperated by 0.05m is  %3.1f degree centigrade \\n (2)The amount of heat crossing per second per unit area normal to the rod is  %3.2g J/s ' % (T, Q)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(1)The difference in temperature between two points seperated by 0.05m is  12.5 degree centigrade \n",
        " (2)The amount of heat crossing per second per unit area normal to the rod is  9.6e+04 J/s \n"
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.64  Page No : 826"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "T1 = 200.  # The first temperature of the black body in K\n",
      "T2 = 2000.  # The second temperature of the black body in K\n",
      "s = 5.672 * 10**-8  # Stefans constant in M.K.S units\n",
      "\n",
      "# Calculations\n",
      "# The comparision of radiant emittance of a black body for given\n",
      "# temperatures\n",
      "R = (s * T1**4) / (s * T2**4)\n",
      "\n",
      "# Output\n",
      "print 'The comparision of radiant emittance of a black body at 200 K and 2000 K is  %3.0g ' % (R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The comparision of radiant emittance of a black body at 200 K and 2000 K is  0.0001 \n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example A.65  Page No : 828"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "# Input data\n",
      "d = 0.08  # The diameter of the black sphere in m\n",
      "T = 500.  # The temperature of the black sphere in K\n",
      "T0 = 300.  # The temperature of the surroundings in K\n",
      "s = 6. * 10**-8  # The stefans constant in W m**-2 K**-4\n",
      "pi = 3.14  # The mathematical constant of pi\n",
      "\n",
      "# Calculations\n",
      "A = pi * d**2  # The area of the black sphere in m**2\n",
      "e = 1.  # The emittance of the black body\n",
      "# The rate at which energy is radiated in J/s or watts\n",
      "R = s * A * e * (T**4 - T0**4)\n",
      "\n",
      "# Output\n",
      "print 'The rate at which energy is radiated R =  %3.2f J/s  (or) %3.2f watts' % (R, R)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The rate at which energy is radiated R =  65.59 J/s  (or) 65.59 watts\n"
       ]
      }
     ],
     "prompt_number": 68
    }
   ],
   "metadata": {}
  }
 ]
}